Skip to content

Commit

Permalink
Merge branch 'release/0.26.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Mar 18, 2021
2 parents 71ada71 + e87fb0c commit 71441fa
Show file tree
Hide file tree
Showing 20 changed files with 762 additions and 194 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "1.0.0",
"version": "1.1.0",
"commands": [
"dotnet-cake"
]
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ mono_crash.*
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
Expand Down Expand Up @@ -65,6 +66,9 @@ project.lock.json
project.fragment.lock.json
artifacts/

# ASP.NET Scaffolding
ScaffoldingReadMe.txt

# StyleCop
StyleCopReport.xml

Expand Down Expand Up @@ -356,6 +360,9 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd

# WinMerge
*.bak

Expand Down
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mode: ContinuousDelivery
branches:
master:
regex: main
regex: (master|main)
mode: ContinuousDelivery
tag:
increment: Patch
Expand Down
4 changes: 2 additions & 2 deletions Source/ZoomNet.IntegrationTests/Tests/Meetings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public async Task RunAsync(string userId, IZoomClient client, TextWriter log, Ca
// Scheduled meeting
var start = DateTime.UtcNow.AddMonths(1);
var duration = 30;
var newScheduledMeeting = await client.Meetings.CreateScheduledMeetingAsync(userId, "ZoomNet Integration Testing: scheduled meeting", "The agenda", start, duration, "p@ss!w0rd", settings, trackingFields, cancellationToken).ConfigureAwait(false);
var newScheduledMeeting = await client.Meetings.CreateScheduledMeetingAsync(userId, "ZoomNet Integration Testing: scheduled meeting", "The agenda", start, duration, TimeZones.UTC, "p@ss!w0rd", settings, trackingFields, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"Scheduled meeting {newScheduledMeeting.Id} created").ConfigureAwait(false);

var updatedSettings = new MeetingSettings() { Audio = AudioType.Voip };
Expand All @@ -81,7 +81,7 @@ public async Task RunAsync(string userId, IZoomClient client, TextWriter log, Ca
WeeklyDays = new[] { DayOfWeek.Monday, DayOfWeek.Friday },
Type = RecurrenceType.Weekly
};
var newRecurringMeeting = await client.Meetings.CreateRecurringMeetingAsync(userId, "ZoomNet Integration Testing: recurring meeting", "The agenda", start, duration, recurrenceInfo, "p@ss!w0rd", settings, trackingFields, cancellationToken).ConfigureAwait(false);
var newRecurringMeeting = await client.Meetings.CreateRecurringMeetingAsync(userId, "ZoomNet Integration Testing: recurring meeting", "The agenda", start, duration, recurrenceInfo, TimeZones.UTC, "p@ss!w0rd", settings, trackingFields, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"Recurring meeting {newRecurringMeeting.Id} created").ConfigureAwait(false);

await client.Meetings.UpdateRecurringMeetingAsync(newRecurringMeeting.Id, topic: "ZoomNet Integration Testing: UPDATED recurring meeting", cancellationToken: cancellationToken).ConfigureAwait(false);
Expand Down
4 changes: 2 additions & 2 deletions Source/ZoomNet.IntegrationTests/Tests/Webinars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task RunAsync(string userId, IZoomClient client, TextWriter log, Ca
// Scheduled webinar
var start = DateTime.UtcNow.AddMonths(1);
var duration = 30;
var newScheduledWebinar = await client.Webinars.CreateScheduledWebinarAsync(userId, "ZoomNet Integration Testing: scheduled webinar", "The agenda", start, duration, "p@ss!w0rd", settings, trackingFields, cancellationToken: cancellationToken).ConfigureAwait(false);
var newScheduledWebinar = await client.Webinars.CreateScheduledWebinarAsync(userId, "ZoomNet Integration Testing: scheduled webinar", "The agenda", start, duration, TimeZones.UTC, "p@ss!w0rd", settings, trackingFields, cancellationToken: cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"Scheduled webinar {newScheduledWebinar.Id} created").ConfigureAwait(false);

await client.Webinars.DeleteAsync(newScheduledWebinar.Id, null, false, cancellationToken).ConfigureAwait(false);
Expand All @@ -58,7 +58,7 @@ public async Task RunAsync(string userId, IZoomClient client, TextWriter log, Ca
WeeklyDays = new[] { DayOfWeek.Monday, DayOfWeek.Friday },
Type = RecurrenceType.Weekly
};
var newRecurringWebinar = await client.Webinars.CreateRecurringWebinarAsync(userId, "ZoomNet Integration Testing: recurring webinar", "The agenda", start, duration, recurrenceInfo, "p@ss!w0rd", settings, trackingFields, cancellationToken: cancellationToken).ConfigureAwait(false);
var newRecurringWebinar = await client.Webinars.CreateRecurringWebinarAsync(userId, "ZoomNet Integration Testing: recurring webinar", "The agenda", start, duration, recurrenceInfo, TimeZones.UTC, "p@ss!w0rd", settings, trackingFields, cancellationToken: cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"Recurring webinar {newRecurringWebinar.Id} created").ConfigureAwait(false);

await client.Webinars.DeleteAsync(newRecurringWebinar.Id, null, false, cancellationToken).ConfigureAwait(false);
Expand Down
3 changes: 2 additions & 1 deletion Source/ZoomNet.UnitTests/Utils.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.Extensions.Logging;
using Pathoschild.Http.Client;
using Pathoschild.Http.Client.Extensibility;
using Pathoschild.Http.Client.Retry;
using RichardSzalay.MockHttp;
using System;
using System.Linq;
Expand All @@ -16,7 +17,7 @@ public static Pathoschild.Http.Client.IClient GetFluentClient(MockHttpMessageHan
{
var httpClient = httpMessageHandler.ToHttpClient();
var client = new FluentClient(new Uri(ZOOM_V2_BASE_URI), httpClient);
client.SetRequestCoordinator(new ZoomRetryCoordinator(new Http429RetryStrategy(), null));
client.SetRequestCoordinator(new IRetryConfig[] { new ExpiredOAuthTokenRetryStrategy(null), new Http429RetryStrategy() });
client.Filters.Remove<DefaultErrorFilter>();
client.Filters.Add(new DiagnosticHandler(LogLevel.Debug, LogLevel.Error));
client.Filters.Add(new ZoomErrorHandler());
Expand Down
31 changes: 31 additions & 0 deletions Source/ZoomNet/Extensions/Internal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,37 @@ internal static long ToUnixTime(this DateTime date)
return Convert.ToInt64((date.ToUniversalTime() - EPOCH).TotalSeconds);
}

/// <summary>
/// Converts a .Net <see cref="DateTime" /> into a string that can be accepted by the Zoom API.
/// </summary>
/// <param name="date">The date.</param>
/// <param name="timeZone">The time zone.</param>
/// <returns>
/// The string representation of the date expressed in the Zoom format.
/// </returns>
internal static string ToZoomFormat(this DateTime? date, TimeZones? timeZone)
{
if (!date.HasValue) return null;
return date.Value.ToZoomFormat(timeZone);
}

/// <summary>
/// Converts a .Net <see cref="DateTime" /> into a string that can be accepted by the Zoom API.
/// </summary>
/// <param name="date">The date.</param>
/// <param name="timeZone">The time zone.</param>
/// <returns>
/// The string representation of the date expressed in the Zoom format.
/// </returns>
internal static string ToZoomFormat(this DateTime date, TimeZones? timeZone)
{
const string defaultDateFormat = "yyyy-MM-dd'T'HH:mm:ss";
const string utcDateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'";

if (timeZone.HasValue && timeZone.Value == TimeZones.UTC) return date.ToUniversalTime().ToString(utcDateFormat);
return date.ToString(defaultDateFormat);
}

/// <summary>
/// Reads the content of the HTTP response as string asynchronously.
/// </summary>
Expand Down

0 comments on commit 71441fa

Please sign in to comment.