From 063e4efac4a7729a915b964d27dde9ba24ab3f8f Mon Sep 17 00:00:00 2001 From: Jericho Date: Mon, 15 Aug 2022 14:25:30 -0400 Subject: [PATCH] (doc) improve code samples --- README.md | 11 ++++------- Source/ZoomNet.IntegrationTests/TestsRunner.cs | 18 +++++++++--------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 37e1ff51..3d9c969b 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ When you have the API key and secret, you can instantiate a 'connection info' ob var apiKey = "... your API key ..."; var apiSecret = "... your API secret ..."; var connectionInfo = new JwtConnectionInfo(apiKey, apiSecret); +var zoomClient = new ZoomClient(connectionInfo); ``` > **Warning:** Zoom has announced that this authentication method would be obsolete in June 2023. The recommendation is to swith to Server-to-Server OAuth. @@ -93,6 +94,7 @@ var connectionInfo = new OAuthConnectionInfo(clientId, clientSecret, authorizati Environment.SetEnvironmentVariable("ZOOM_OAUTH_REFRESHTOKEN", newRefreshToken, EnvironmentVariableTarget.User); Environment.SetEnvironmentVariable("ZOOM_OAUTH_ACCESSTOKEN", newAccessToken, EnvironmentVariableTarget.User); }); +var zoomClient = new ZoomClient(connectionInfo); ``` > **Warning:** This sample I just provided can be used only when Zoom issues a new the autorization code. ZoomNet will take care of converting this code into an access token at which point the autorization code is no longer valid. @@ -109,6 +111,7 @@ var connectionInfo = new OAuthConnectionInfo(clientId, clientSecret, refreshToke Environment.SetEnvironmentVariable("ZOOM_OAUTH_REFRESHTOKEN", newRefreshToken, EnvironmentVariableTarget.User); Environment.SetEnvironmentVariable("ZOOM_OAUTH_ACCESSTOKEN", newAccessToken, EnvironmentVariableTarget.User); }); +var zoomClient = new ZoomClient(connectionInfo); ``` #### Connection using Server-to-Server OAuth @@ -137,18 +140,12 @@ var connectionInfo = new OAuthConnectionInfo(clientId, clientSecret, accountId, a null value in lieu of a delegate. */ }); +var zoomClient = new ZoomClient(connectionInfo); ``` The delegate being optional in the server-to-server scenario you can therefore simplify the connection info declaration like so: ```csharp var connectionInfo = new OAuthConnectionInfo(clientId, clientSecret, accountId, null); -``` - - -### Client - -You declare your client variable like so: -```csharp var zoomClient = new ZoomClient(connectionInfo); ``` diff --git a/Source/ZoomNet.IntegrationTests/TestsRunner.cs b/Source/ZoomNet.IntegrationTests/TestsRunner.cs index 5d024013..f1fbc005 100644 --- a/Source/ZoomNet.IntegrationTests/TestsRunner.cs +++ b/Source/ZoomNet.IntegrationTests/TestsRunner.cs @@ -111,16 +111,16 @@ public async Task RunAsync() // These are the integration tests that we will execute var integrationTests = new Type[] { - typeof(Accounts), - typeof(Chat), - typeof(CloudRecordings), - typeof(Contacts), - typeof(Dashboards), - typeof(Meetings), - typeof(Roles), + //typeof(Accounts), + //typeof(Chat), + //typeof(CloudRecordings), + //typeof(Contacts), + //typeof(Dashboards), + //typeof(Meetings), + //typeof(Roles), typeof(Users), - typeof(Webinars), - typeof(Reports) + //typeof(Webinars), + //typeof(Reports) }; // Get my user and permisisons