You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have faced a few scenarios lately where I attempted to add optional parameters to OAuthConnectionInfo constructors to accommodate specific scenarios but it resulted in Visual Studio complaining that constructors are ambiguous. This is due to the fact that this class has four different constructors (one for each of the four major OAuth scenarios) and invoking one of these constructor while omitting certain optional parameters makes it unclear which of the 4 constructors the developer is attempting to invoke.
I propose replacing these 4 constructors and with 4 static methods with distinct names (hence removing the ambiguity even in scenarios where the parameters are similar). The constructors would be marked as obsolete for some time and eventually removed from the library which would allow developers to transition to the new syntax at their own pace.
For example, here's how the syntax for a Server-to-Server scenario would be impacted:
// Old syntax:varconnectionInfo=new OAuthConnectionInfo(clientId, clientSecret, accountId,null);// New syntax:varconnectionInfo= OAuthConnectionInfo.ForServerToServer(clientId, clientSecret, accountId);
Here's how the syntax for a scenario where developer provides the refresh token would be impacted:
// Old syntax:varconnectionInfo=new OAuthConnectionInfo(clientId, clientSecret, refreshToken,null,(newRefreshToken,newAccessToken)=>{ Environment.SetEnvironmentVariable("ZOOM_OAUTH_REFRESHTOKEN", newRefreshToken, EnvironmentVariableTarget.User);});// New syntax:varconnectionInfo= OAuthConnectionInfo.WithRefreshToken(clientId, clientSecret, refreshToken,null,(newRefreshToken,newAccessToken)=>{ Environment.SetEnvironmentVariable("ZOOM_OAUTH_REFRESHTOKEN", newRefreshToken, EnvironmentVariableTarget.User);});
The text was updated successfully, but these errors were encountered:
I have faced a few scenarios lately where I attempted to add optional parameters to OAuthConnectionInfo constructors to accommodate specific scenarios but it resulted in Visual Studio complaining that constructors are ambiguous. This is due to the fact that this class has four different constructors (one for each of the four major OAuth scenarios) and invoking one of these constructor while omitting certain optional parameters makes it unclear which of the 4 constructors the developer is attempting to invoke.
I propose replacing these 4 constructors and with 4 static methods with distinct names (hence removing the ambiguity even in scenarios where the parameters are similar). The constructors would be marked as obsolete for some time and eventually removed from the library which would allow developers to transition to the new syntax at their own pace.
For example, here's how the syntax for a Server-to-Server scenario would be impacted:
Here's how the syntax for a scenario where developer provides the refresh token would be impacted:
The text was updated successfully, but these errors were encountered: