mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-05 23:06:10 +00:00
* update models with updated permission enum * add suppress message attribute * update integration tests * refactor: new and legacy update teams endpint * refactor: add new delete team endpoint * use TeamPermission on NewTeam * use updated delete on team context dispose * add permission enum for team response object * refactor: remove legacy suffix from method names * introduce permissions object on Team * refactor: rename enum to TeamRepositoryPermission * fix formatting * change Permission to string to match api specs * add TeamRepository * add CheckTeamPermission endpoint support * fix convention tests * update comments on TeamRepository props * add two new endpoints in TeamsClient * refactor: rename ApiUrl for TeamPermission * fix test * implement methods for new endpoints * add the integration tests * fix spelling * update comments * refactor: rename method name * fix: add end tag for remarks * refactor: remove unused method param * fix docstring comment * the unit tests are in finally * add docs for teams api * split CheckTeamPermissions into two methods * Update ObservableTeamsClientTests.cs based on review Co-authored-by: Keegan Campbell <me@kfcampbell.com> * add cref to legacy update and delete endpoints * remove editorconfig file * Update Octokit.Tests/Clients/TeamsClientTests.cs Co-authored-by: Keegan Campbell <me@kfcampbell.com> * remove unused line * rename variable based on review * rename prop to match constructor param * add comment to explain TeamPermission enum values on update Co-authored-by: notauserx <notauserx@users.noreply.github.com> Co-authored-by: Keegan Campbell <me@kfcampbell.com>
58 lines
1.9 KiB
C#
58 lines
1.9 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
using System.Globalization;
|
|
|
|
namespace Octokit
|
|
{
|
|
/// <summary>
|
|
/// Used to update a team.
|
|
/// </summary>
|
|
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
|
public class UpdateTeam
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="UpdateTeam"/> class.
|
|
/// </summary>
|
|
/// <param name="name">The updated team name.</param>
|
|
public UpdateTeam(string name)
|
|
{
|
|
Name = name;
|
|
}
|
|
|
|
/// <summary>
|
|
/// The name of the team (required).
|
|
/// </summary>
|
|
public string Name { get; private set; }
|
|
|
|
/// <summary>
|
|
/// The description of the team.
|
|
/// </summary>
|
|
public string Description { get; set; }
|
|
|
|
/// <summary>
|
|
/// The level of privacy this team should have (default: Secret)
|
|
/// </summary>
|
|
public TeamPrivacy? Privacy { get; set; }
|
|
|
|
/// <summary>
|
|
/// The permission that new repositories will be added to the team with when none is specified (default: Pull)
|
|
/// Although permission can be one of : pull, push, or admin based on documentation, passing admin results in an error response.
|
|
/// That's why TeamPermission does not contain an admin value.
|
|
/// See the issue here https://github.com/github/rest-api-description/issues/1952
|
|
/// </summary>
|
|
public TeamPermission? Permission { get; set; }
|
|
|
|
/// <summary>
|
|
/// Id of a team to set as the parent team
|
|
/// </summary>
|
|
public long? ParentTeamId { get; set; }
|
|
|
|
internal string DebuggerDisplay
|
|
{
|
|
get
|
|
{
|
|
return string.Format(CultureInfo.InvariantCulture, "Team: {0} Privacy: {1} Permission: {2}", Name, Privacy?.ToString() ?? "Default", Permission?.ToString() ?? "Default");
|
|
}
|
|
}
|
|
}
|
|
} |