Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/support service plan #47

Merged
merged 11 commits into from
Apr 3, 2024
Merged

Feat/support service plan #47

merged 11 commits into from
Apr 3, 2024

Conversation

Dovchik
Copy link
Contributor

@Dovchik Dovchik commented Mar 28, 2024

Add support for Service plan id of sms api. Which can be set via SinchOptions

@@ -0,0 +1,33 @@
namespace Sinch.SMS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this will be an added value from SDK user's perspective : defining a dedicated type for supported region in case of service plan id usage
This mean if for test or any other reason user switch from projectId <-> servicePlanId usage the region as also to be changed. Not because wanting to changed to the region but because type is different.
e.g.: Still addressing us region in both cases but have to change SmsHostingRegion.Us <-> SmsServicePlanIdHostingRegion.Us
Even if supported regions are not equals, a dynamic validation against unexpected values should be enough.
And even in this case: it should be a warning and not an error. So in case of server going forward to support new region, SDK's user do not need to move to a new (but not yet ready release) SDK updated version

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll keep dedicated type for regions as sets of supported are different. For any 'I don't want checks' users it's a record so new SmsServicePlainIdHostingRegion('cn') should work.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the SDK user's point of view, a region is just a region: the EU, the USA, ... are no different targets when approached by service plan or project.
What is the added value of complexity for SDK's user?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The supported set of regions are different, and different enums reflects just that.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to be discussed within the team. Item added in the parking lot

httpSnakeCase);
}

private static Uri GetSmsBaseAddress(SmsServicePlanIdHostingRegion smsServicePlanIdHostingRegion,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to previous comment about different types for same region usage: method signature based onto region type is used to trigger servicePlanId vs projectId URL.
This should be related to servicePlanId usage not onto region type usage

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm renaming the method to better reflect underlying functionality

src/Sinch/SinchOptions.cs Outdated Show resolved Hide resolved
examples/Console/UseServicePlanIdForSms.cs Outdated Show resolved Hide resolved
Copy link

@asein-sinch asein-sinch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed during the standup meeting, we'll address the regions handling after it's discussed in details within the team

@Dovchik Dovchik merged commit 8190b04 into main Apr 3, 2024
3 checks passed
@Dovchik Dovchik deleted the feat/support-service-plan-id branch April 3, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants