Comments (8)
@haacked how do you want org teams to be implemented (I am new to this so please bear with me).
Would something like this work?
/// <summary>
/// organization teams
/// </summary>
public class Team
{
/// <summary>
/// team name
/// </summary>
public string Name { get; set; }
/// <summary>
/// team id
/// </summary>
public int Id { get; set; }
public Permission Permissions { get; set; }
public ICollection<User> Members { get; set; }
public ICollection<Repository> Repositories { get; set; }
}
public enum Permission
{
/// <summary>
/// team members can pull, push and administer these repositories.
/// </summary>
admin,
/// <summary>
/// team members can pull and push, but not administer these repositories
/// </summary>
push,
/// <summary>
/// team members can pull, but not push to or administer these repositories
/// </summary>
pull
}
Then should I add a property onto the org class called
public Team Teams {get; set;}
Just wondering what the best way to go about this is... Thanks.
from octokit.net.
@hahmed Thanks for offering to chip in. Take a look at the other clients, especially the Orgs client to get an idea of how clients are implemented.
For example, instead of ICollection
we use IReadOnlyList
.
We also tend to create classes specifically for creating and updating entities. For example, we'd have a NewTeam
and a TeamUpdate
class for the Create
and Update
methods.
Also, for the enum, use standard .NET naming conventions (aka Pascal casing) for the fields: Admin, Push, Pull
.
Our JSON serializer will fix it up to match what is expected by the API.
Then should I add a property onto the org class called
No, you'll need to create an ITeamsClient
interface and implement it TeamsClient
. Then add a property to IOrganizationsClient
named Team
of type ITeamsClient
. make sense?
from octokit.net.
@haacked It's cool, love to help - hope I can be of help.
So far I got:
Never understood this bit:
Then add a property to IOrganizationsClient named Team of type ITeamsClient.
from octokit.net.
@hahmed go aheand and open a pull request. Just prefix it with WIP to let us know it's in progress. Much easier to discuss this in the pull request.
http://blog.myget.org/post/2013/10/14/GitHub-Commit-Status-API-now-supported.aspx
In pseudocode
interface IOrganizationsClient {
ITeamsClient Team { get; }
}
from octokit.net.
@haacked Does that mean you want the Teams Api to be only available to end users via OrgsClient.
For example:
OrgsClient.Team.GetAllTeams(string org);
OrgsClient.Team.NewTeam(string name, Permission permission = Permission.Pull) //(default param)
etc.
I assumed you wanted the TeamClient to be separate like I did so in my PR?
from octokit.net.
Does that mean you want the Teams Api to be only available to end users via OrgsClient.
Yep. We're trying to map our API to the structure of the GitHub API http://developer.github.com/v3/orgs/
For context see: #131 (comment)
from octokit.net.
@haacked if the above pr gets merged I think that is everything that I needed to implement this feature. Let me know if I have missed anything so I can get this feature fully wrapped up.
from octokit.net.
🆒 I found a potential issue with the PR. But most of it looks great!
from octokit.net.
Related Issues (20)
- [BUG]: class Artifact is in global namespace HOT 5
- [DOCS] documentation site 'Edit On GitHub' links return a 404 HOT 6
- [FEAT]: Private Repo access ( get the details of the issues , Code & Bugs ) in C#
- [BUG]: exception "mediatype is null or empty" when trying to delete file HOT 2
- [MAINT]: Clean Up All ~1132 `xUnit` Build Error Warnings HOT 1
- [BUG]: ValidateLINQPadSamples and TearDown Errors
- [BUG]: Failed API calls update response cache HOT 1
- [FEAT]: Download Release archive files
- [FEAT]: Cancel an organization invitation
- [BUG]: WorkflowJobStatus enum does not contain "pending" value. HOT 4
- octokit is missing NuGet package README file
- [BUG]: Error deserializing new issues HOT 18
- [BUG]: Timeout getting multiple renamed repositories when running in NET Framework HOT 1
- [BUG]: Int32 overflow for Github object ids HOT 4
- [FEAT]: Create an organization invitation via email address
- [BUG]: Accessing Pull Requests from all GHE Org Repos (internal included)
- [BUG]: Download Artifact - Content Stores Differing Content-Types Cause Errors HOT 8
- [FEAT]: Implementation for gitHubClient.Branches HOT 1
- [BUG/FEAT]: BranchProtetionPushRestictions Properties Should Be Nullable HOT 1
- [BUG]: Github Enterprise License API fails when parsing temp license HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from octokit.net.