-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(GH-176) GetSurvey, DeleteSurvey and UpdateSurvey
- Loading branch information
Showing
6 changed files
with
252 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,6 +148,53 @@ public async Task RunAsync(string userId, IZoomClient client, TextWriter log, Ca | |
var approvedRegistrations = await client.Meetings.GetRegistrantsAsync(scheduledMeeting.Id, RegistrantStatus.Approved, null, 30, null, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"This meeting has {pendingRegistrations.TotalRecords} registrations awaiting approval and {approvedRegistrations.TotalRecords} approved registrations").ConfigureAwait(false); | ||
|
||
var surveyQuestions = new[] | ||
{ | ||
new SurveyQuestion | ||
{ | ||
Name = "Did you like the meeting?", | ||
IsRequired = true, | ||
ShowAsDropdown = false, | ||
Type = SurveyQuestionType.Single, | ||
Answers = new[] { "Yes", "No"} | ||
}, | ||
new SurveyQuestion | ||
{ | ||
Name = "Rate the presenter", | ||
IsRequired = true, | ||
ShowAsDropdown = false, | ||
Type = SurveyQuestionType.Rating_Scale, | ||
RatingMinimumValue = 1, | ||
RatingMaximumValue = 10, | ||
RatingLowScoreLabel = "Mediocre", | ||
RatingHighScoreLabel = "Excellent" | ||
}, | ||
new SurveyQuestion | ||
{ | ||
Name = "Select the product(s) that interest you", | ||
IsRequired = false, | ||
ShowAsDropdown = false, | ||
Type = SurveyQuestionType.Multiple, | ||
Answers = new[] { "Gizmo number 1", "Gizmo number 2", "SuperDuper Gizmo"} | ||
}, | ||
new SurveyQuestion | ||
{ | ||
Name = "Comment", | ||
IsRequired = false, | ||
Type = SurveyQuestionType.Long, | ||
MinimumNumberOfCharacters = 10, | ||
MaximumNumberOfCharacters = 1999 | ||
}, | ||
}; | ||
await client.Meetings.UpdateSurveyAsync(scheduledMeeting.Id, surveyQuestions, true, true, "https://jeremiedesautels.com", cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync("Survey was updated").ConfigureAwait(false); | ||
|
||
var survey = await client.Meetings.GetSurveyAsync(scheduledMeeting.Id, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync("Survey was retrieved").ConfigureAwait(false); | ||
|
||
await client.Meetings.DeleteSurveyAsync(scheduledMeeting.Id, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync("Survey was deleted").ConfigureAwait(false); | ||
|
||
await client.Meetings.CancelRegistrantAsync(scheduledMeeting.Id, registrantInfo1.Id, "[email protected]", null, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"Registration {registrant1.Id} was canceled").ConfigureAwait(false); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// Survey. | ||
/// </summary> | ||
public class Survey | ||
{ | ||
/// <summary> | ||
/// Gets or sets the link to the third party meeting survey. | ||
/// </summary> | ||
[JsonProperty("third_party_survey")] | ||
public string ThirdPartySurveyLink { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the survey will be displayed in the attendee's browser. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "show_in_the_browser")] | ||
public bool ShowInBrowser { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the information about the customized survey. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "custom_survey")] | ||
public SurveyDetails Details { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// Survey details. | ||
/// </summary> | ||
public class SurveyDetails | ||
{ | ||
/// <summary> | ||
/// Gets or sets a value indicating whether to allow participants to anonymously answer survey questions. | ||
/// </summary> | ||
[JsonProperty("anonymous")] | ||
public bool AllowAnonymous { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the survey questions. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "questions")] | ||
public SurveyQuestion[] Questions { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// Survey question. | ||
/// </summary> | ||
public class SurveyQuestion | ||
{ | ||
/// <summary> | ||
/// Gets or sets the survey question. | ||
/// </summary> | ||
/// <remarks>Up to 255 characters.</remarks> | ||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the question type. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "type")] | ||
public SurveyQuestionType Type { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the possible answers will be displayed as a drop-down box. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "show_as_dropdown")] | ||
public bool ShowAsDropdown { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the question must be answered. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "answer_required")] | ||
public bool IsRequired { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the possible answers to chose from. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "answers")] | ||
public string[] Answers { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the minimum number of characters. | ||
/// This field only applies to questions of type 'Long'. | ||
/// </summary> | ||
/// <remarks>Must be greather or equal to 1.</remarks> | ||
[JsonProperty(PropertyName = "answer_min_character")] | ||
public int? MinimumNumberOfCharacters { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the maximum number of characters. | ||
/// This field only applies to questions of type 'Long'. | ||
/// </summary> | ||
/// <remarks>Must be smaller or equal to 2,000.</remarks> | ||
[JsonProperty(PropertyName = "answer_max_character")] | ||
public int? MaximumNumberOfCharacters { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the rating minimum value. | ||
/// This field only applies to questions of type 'Rating'. | ||
/// </summary> | ||
/// <remarks>Must be greather or equal to 0.</remarks> | ||
[JsonProperty(PropertyName = "rating_min_value")] | ||
public int? RatingMinimumValue { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the rating maximum value. | ||
/// This field only applies to questions of type 'Rating'. | ||
/// </summary> | ||
/// <remarks>Must be smaller or equal to 10.</remarks> | ||
[JsonProperty(PropertyName = "rating_max_value")] | ||
public int? RatingMaximumValue { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the low score label. | ||
/// This field only applies to questions of type 'Rating'. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "rating_min_label")] | ||
public string RatingLowScoreLabel { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the high score label. | ||
/// This field only applies to questions of type 'Rating'. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "rating_max_label")] | ||
public string RatingHighScoreLabel { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters