messagemedia / messagemedia-rest-api-csharp-sdk

⚠️ Deprecated | MessageMedia REST API C# SDK
1 stars 2 forks source link

Build issues #2

Open youngm24 opened 7 years ago

youngm24 commented 7 years ago

I could not build the project as published because the ASYNC methods set some enums to null.

Sample error: CS1750 C# A value of type '' cannot be used as a default parameter because there are no standard conversions to type

Sample call with the issue from Model\AsyncDeliveryReportDetailRequest.cs (See the variables called *Body, they are enums and not nullable, like SortDirectionBody )

public AsyncDeliveryReportDetailRequest(StartDateBody StartDate = null, EndDateBody EndDate = null, SortByEnum? SortBy = null, SortDirectionBody SortDirection = null, TimezoneBody Timezone = null, AccountsBody Accounts = null, DestinationAddressCountryBody DestinationAddressCountry = null, DestinationAddressBody DestinationAddress = null, MessageFormatBody MessageFormat = null, MetadataKeyBody MetadataKey = null, MetadataValueBody MetadataValue = null, StatusCodeBody StatusCode = null, StatusBody Status = null, SourceAddressCountryBody SourceAddressCountry = null, SourceAddressBody SourceAddress = null, DeliveryOptionsBody DeliveryOptions = null)

Am I just missing something?

mjoksa commented 7 years ago

I can confirm that there are build errors that are related on how default parameters are defined, so for each error code should be changed like in example below from SortDirectionBody SortDirection = null to SortDirectionBody SortDirection = default(SortDirectionBody) As a reference, there are 21 errors like this

youngm24 commented 7 years ago

Thank you! You can also set each one to a value in the enum, but your solution is better because you can use/change the default.

The compiler will also flag all the checks for null on the enums, but that will not stop the compile.

Thanks for the great tip and for confirming the bug.

From: mjoksa [mailto:notifications@github.com] Sent: Tuesday, April 18, 2017 4:26 AM To: messagemedia/messagemedia-rest-api-csharp-sdk messagemedia-rest-api-csharp-sdk@noreply.github.com Cc: Michelle Young Michelle.Young@quantum-health.com; Author author@noreply.github.com Subject: Re: [messagemedia/messagemedia-rest-api-csharp-sdk] Build issues (#2)

QUANTUM HEALTH Security Notice: This email came from someone OUTSIDE Quantum Health. Think before you click!

I can confirm that there are build errors that are related on how default parameters are defined, so for each error code should be changed like in example below from SortDirectionBody SortDirection = null to SortDirectionBody SortDirection = default(SortDirectionBody) As a reference, there are 21 errors like this

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/messagemedia/messagemedia-rest-api-csharp-sdk/issues/2#issuecomment-294727457, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AaWQ77F1gpwwLyyoXCM7zJ3hukVPVHiTks5rxHOugaJpZM4M-orA.