Skip to content

Commit

Permalink
Merge branch 'release/0.47.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Aug 3, 2022
2 parents df97b7a + fd4b852 commit c744111
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 66 deletions.
3 changes: 2 additions & 1 deletion Source/ZoomNet.IntegrationTests/TestsRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public async Task<int> RunAsync()
// {
// Environment.SetEnvironmentVariable("ZOOM_OAUTH_REFRESHTOKEN", newRefreshToken, EnvironmentVariableTarget.User);
// Environment.SetEnvironmentVariable("ZOOM_OAUTH_ACCESSTOKEN", newAccessToken, EnvironmentVariableTarget.User);
// });
// },
// null);
}
}

Expand Down
5 changes: 5 additions & 0 deletions Source/ZoomNet/Models/MeetingType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public enum MeetingType
/// </summary>
Personal = 4,

/// <summary>
/// A PAC (Personal Audio Conference) meeting
/// </summary>
PersonalAudioConference = 7,

/// <summary>
/// Recurring meeting with fixed time.
/// </summary>
Expand Down
112 changes: 67 additions & 45 deletions Source/ZoomNet/Models/PastMeeting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ namespace ZoomNet.Models
/// </summary>
public class PastMeeting
{
/// <summary>
/// Gets or sets the meeting id, also known as the meeting number.
/// </summary>
/// <value>
/// The id.
/// </value>
[JsonPropertyName("id")]
public long Id { get; set; }

/// <summary>
/// Gets or sets the unique id.
/// </summary>
Expand All @@ -18,13 +27,25 @@ public class PastMeeting
public string Uuid { get; set; }

/// <summary>
/// Gets or sets the meeting id, also known as the meeting number.
/// Gets or sets the meeting duration in minutes.
/// </summary>
/// <value>
/// The id.
/// </value>
[JsonPropertyName("id")]
public long Id { get; set; }
/// <value>The meeting duration.</value>
[JsonPropertyName("duration")]
public long Duration { get; set; }

/// <summary>
/// Gets or sets the date and time when the meeting started.
/// </summary>
/// <value>The meeting start time.</value>
[JsonPropertyName("start_time")]
public DateTime StartedOn { get; set; }

/// <summary>
/// Gets or sets the date and time when the meeting ended.
/// </summary>
/// <value>The meeting end time.</value>
[JsonPropertyName("end_time")]
public DateTime EndedOn { get; set; }

/// <summary>
/// Gets or sets the ID of the user who is set as the host of the meeting.
Expand All @@ -36,68 +57,69 @@ public class PastMeeting
public string HostId { get; set; }

/// <summary>
/// Gets or sets the topic of the meeting.
/// Gets or sets the meeting host's department.
/// </summary>
/// <value>
/// The topic.
/// The department.
/// </value>
[JsonPropertyName("topic")]
public string Topic { get; set; }
[JsonPropertyName("dept")]
public string Department { get; set; }

/// <summary>
/// Gets or sets the meeting type.
/// </summary>
/// <value>The meeting type.</value>
[JsonPropertyName("type")]
public MeetingType Type { get; set; }

/// <summary>
/// Gets or sets the user display name.
/// Gets or sets the number of participants.
/// </summary>
/// <value>The user display name.</value>
[JsonPropertyName("user_name")]
public string UserName { get; set; }
/// <value>The number of participants.</value>
[JsonPropertyName("participants_count")]
public long ParticipantsCount { get; set; }

/// <summary>
/// Gets or sets the user email.
/// Gets or sets the value indicating whether the meeting was created directly through Zoom or via an API request.
/// </summary>
/// <value>The user email.</value>
[JsonPropertyName("user_email")]
public string UserEmail { get; set; }
/// <remarks>
/// If the meeting was created via an OAuth app, this field returns the OAuth app's name.
/// If the meeting was created via JWT or the Zoom Web Portal, this returns the Zoom value.
/// </remarks>
/// <value>
/// The source.
/// </value>
[JsonPropertyName("source")]
public string Source { get; set; }

/// <summary>
/// Gets or sets the date and time when the meeting started.
/// Gets or sets the topic of the meeting.
/// </summary>
/// <value>The meeting start time.</value>
[JsonPropertyName("start_time")]
public DateTime StartedOn { get; set; }
/// <value>
/// The topic.
/// </value>
[JsonPropertyName("topic")]
public string Topic { get; set; }

/// <summary>
/// Gets or sets the date and time when the meeting ended.
/// Gets or sets the sum of meeting minutes from all participants.
/// </summary>
/// <value>The meeting end time.</value>
[JsonPropertyName("end_time")]
public DateTime EndedOn { get; set; }
/// <value>The total meeting minutes.</value>
[JsonPropertyName("total_minutes")]
public long TotalMinutes { get; set; }

/// <summary>
/// Gets or sets the meeting duration in minutes.
/// Gets or sets the meeting type.
/// </summary>
/// <value>The meeting duration.</value>
[JsonPropertyName("duration")]
public long Duration { get; set; }
/// <value>The meeting type.</value>
[JsonPropertyName("type")]
public MeetingType Type { get; set; }

/// <summary>
/// Gets or sets the sum of meeting minutes from all participants.
/// Gets or sets the user email.
/// </summary>
/// <value>The total meeting minutes.</value>
[JsonPropertyName("total_minutes")]
public long TotalMinutes { get; set; }
/// <value>The user email.</value>
[JsonPropertyName("user_email")]
public string UserEmail { get; set; }

/// <summary>
/// Gets or sets the number of participants.
/// Gets or sets the user display name.
/// </summary>
/// <value>The number of participants.</value>
[JsonPropertyName("participants_count")]
public long ParticipantsCount { get; set; }
/// <value>The user display name.</value>
[JsonPropertyName("user_name")]
public string UserName { get; set; }
}
}
4 changes: 2 additions & 2 deletions Source/ZoomNet/Resources/DataCompliance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace ZoomNet.Resources
/// This resource can only be used when you connect to Zoom using OAuth. It cannot be used with a Jwt connection.
/// See <a href="https://marketplace.zoom.us/docs/api-reference/data-compliance/">Zoom documentation</a> for more information.
/// </remarks>
[Obsolete("The Data Complaince API is deprecated")]
[Obsolete("The Data Compliance API is deprecated")]
public class DataCompliance : IDataCompliance
{
private readonly Pathoschild.Http.Client.IClient _client;
Expand All @@ -43,7 +43,7 @@ internal DataCompliance(Pathoschild.Http.Client.IClient client)
/// <returns>
/// The async task.
/// </returns>
[Obsolete("The Data Complaince API is deprecated")]
[Obsolete("The Data Compliance API is deprecated")]
public Task NotifyAsync(string userId, long accountId, AppDeauthorizedEvent deauthorizationEventReceived, CancellationToken cancellationToken = default)
{
// Prepare the request (but do not dispatch it yet)
Expand Down
2 changes: 1 addition & 1 deletion Source/ZoomNet/Resources/IPastMeetings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface IPastMeetings
/// <returns>
/// The <see cref="Meeting" />.
/// </returns>
Task<Meeting> GetAsync(string uuid, CancellationToken cancellationToken = default);
Task<PastMeeting> GetAsync(string uuid, CancellationToken cancellationToken = default);

/// <summary>
/// List participants of a meeting that occured in the past.
Expand Down
4 changes: 2 additions & 2 deletions Source/ZoomNet/Resources/PastMeetings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ internal PastMeetings(Pathoschild.Http.Client.IClient client)
/// <returns>
/// The <see cref="Meeting" />.
/// </returns>
public Task<Meeting> GetAsync(string uuid, CancellationToken cancellationToken = default)
public Task<PastMeeting> GetAsync(string uuid, CancellationToken cancellationToken = default)
{
return _client
.GetAsync($"past_meetings/{uuid}")
.WithCancellationToken(cancellationToken)
.AsObject<Meeting>();
.AsObject<PastMeeting>();
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Source/ZoomNet/Utilities/DiagnosticHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private void LogContent(StringBuilder diagnostic, HttpContent httpContent)
if (contentLength > 0)
{
diagnostic.AppendLine();
diagnostic.AppendLine(httpContent.ReadAsStringAsync(null).GetAwaiter().GetResult() ?? "<NULL>");
diagnostic.AppendLine(httpContent.ReadAsStringAsync(null).ConfigureAwait(false).GetAwaiter().GetResult() ?? "<NULL>");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/ZoomNet/Utilities/OAuthTokenHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public string RefreshTokenIfNecessary(bool forceRefresh)
var requestTime = DateTime.UtcNow;
var request = new HttpRequestMessage(HttpMethod.Post, requestUrl);
request.Headers.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes($"{_connectionInfo.ClientId}:{_connectionInfo.ClientSecret}")));
var response = _httpClient.SendAsync(request).GetAwaiter().GetResult();
var response = _httpClient.SendAsync(request).ConfigureAwait(false).GetAwaiter().GetResult();
var responseContent = response.Content.ReadAsStringAsync(null).ConfigureAwait(false).GetAwaiter().GetResult();

if (string.IsNullOrEmpty(responseContent)) throw new Exception(response.ReasonPhrase);
Expand Down
2 changes: 1 addition & 1 deletion Source/ZoomNet/Utilities/ZoomErrorHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void OnRequest(IRequest request) { }
/// <param name="httpErrorAsException">Whether HTTP error responses should be raised as exceptions.</param>
public void OnResponse(IResponse response, bool httpErrorAsException)
{
var (isError, errorMessage, errorCode) = response.Message.GetErrorMessageAsync().GetAwaiter().GetResult();
var (isError, errorMessage, errorCode) = response.Message.GetErrorMessageAsync().ConfigureAwait(false).GetAwaiter().GetResult();
var diagnosticInfo = response.GetDiagnosticInfo();
var diagnosticLog = diagnosticInfo.Diagnostic ?? "Diagnostic log unavailable";

Expand Down
24 changes: 12 additions & 12 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#tool dotnet:?package=coveralls.net&version=4.0.0
#tool nuget:?package=GitReleaseManager&version=0.13.0
#tool nuget:?package=ReportGenerator&version=5.1.9
#tool nuget:?package=xunit.runner.console&version=2.4.1
#tool nuget:?package=xunit.runner.console&version=2.4.2
#tool nuget:?package=Codecov&version=1.13.0

// Install addins.
Expand Down Expand Up @@ -299,17 +299,17 @@ Task("Upload-Coverage-Result")
.IsDependentOn("Run-Code-Coverage")
.Does(() =>
{
try
{
CoverallsNet(new FilePath($"{codeCoverageDir}coverage.{DefaultFramework}.xml"), CoverallsNetReportType.OpenCover, new CoverallsNetSettings()
{
RepoToken = coverallsToken
});
}
catch (Exception e)
{
Warning(e.Message);
}
//try
//{
// CoverallsNet(new FilePath($"{codeCoverageDir}coverage.{DefaultFramework}.xml"), CoverallsNetReportType.OpenCover, new CoverallsNetSettings()
// {
// RepoToken = coverallsToken
// });
//}
//catch (Exception e)
//{
// Warning(e.Message);
//}

try
{
Expand Down

0 comments on commit c744111

Please sign in to comment.