Files
octokit.net/Octokit/Models/Response/RepositoryInvitation.cs
Martin Scholz 89500f4b8a Repository invitations changes (#1410)
* add invitations accept header

* create class RepositoryInvitation

* add repository invitations client

* add api urls for invitations

* [WIP]

* add methods to repository invitations client

* add invite method to repo collaborators client

need to add some new overload to post method in apiconnection

* some changes

* add observable client

* add dependings

* add missing observable client

* add missing xml params

* check client

* change repository invitation model

* [WIP] tests

* [WIP] tests; fix overloads for client

* change GetAllForCurrent; suppress message

* some more tests

* [WIP]

* [WIP]

* add collaborator request model

* change return types

change return types for invitation methods. add permission attribute for
repository collaborators invite method.

* add some more tests

* fix xml doc

* check for null arguments

* fix tests

* some fixes from @ryangribble

* add parameterless constructor for RepositoryInvitation

* change setter

* change constructor

* fix merge conflicts

* [WIP] RepositoryInvitationsClientTests

* fix api url xml

* change collaborator request constructor

* change unit tests for collaborator request

* change repocollaboratorsclient

change overloads for add in invite methods to set permissions

* [WIP] integration tests

* add methods for interface

* NotFoundExceptions

* add overload for invite method

* rename repo property

* gramar

* overloads for observable repo collaborators client

* change integration tests

* new integration tests

* add decline test

* add test for accept invitation
2016-07-23 18:50:22 +10:00

57 lines
1.5 KiB
C#

using System;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
public enum InvitationPermissionType
{
Read,
Write,
Admin
}
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class RepositoryInvitation
{
public RepositoryInvitation() { }
public RepositoryInvitation(int id, Repository repository, User invitee, User inviter, InvitationPermissionType permissions, DateTimeOffset createdAt, string url, string htmlUrl)
{
Id = id;
Repository = repository;
Invitee = invitee;
Inviter = inviter;
Permissions = permissions;
CreatedAt = createdAt;
Url = url;
HtmlUrl = htmlUrl;
}
public int Id { get; protected set; }
public Repository Repository { get; protected set; }
public User Invitee { get; protected set; }
public User Inviter { get; protected set; }
public InvitationPermissionType Permissions { get; protected set; }
public DateTimeOffset CreatedAt { get; protected set; }
public string Url { get; protected set; }
public string HtmlUrl { get; protected set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture,
"Repository Invitation: Id: {0} Permissions: {1}", Id, Permissions);
}
}
}
}