Skip to content

Instantly share code, notes, and snippets.

@M-Zuber
Last active February 5, 2016 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save M-Zuber/6c49f6ad1a77980cfec5 to your computer and use it in GitHub Desktop.
Save M-Zuber/6c49f6ad1a77980cfec5 to your computer and use it in GitHub Desktop.
first-timer issue for octokit.net

As per the API documentation the RepositoryRequest class is missing some options. The options missing are visibility and affiliation.

Read this to get setup for contributing

Steps to implement:

  • Add the following enums

  • Visibility:

    • Public
    • Private
    • All
  • Affiliation: Some of the Affiliation enum members have to be decorated with the Parameter attribute so they are serialized properly

    • Owner
    • Collaborator
    • OrganizationMember:[Parameter(Value = "organization_member")]
    • OwnerAndCollaborator:[Parameter(Value = "owner, collaborator")]
    • OwnerAndOrganizationMember:[Parameter(Value = "owner, organization_member")]
    • CollaboratorAndOrganizationMember:[Parameter(Value = "collaborator, organization_member")]
    • All:[Parameter(Value = "owner, collaborator, organization_member")]
  • Add proprties to the RepositoryRequest class.

@M-Zuber
Copy link
Author

M-Zuber commented Jan 27, 2016

We probably want an All item on the Affiliation enum.
I am double checking how the ToString will look if just bitwise is used.
Even though as long as the values start from 1, the ToString works nicely, since the names in the enum do not match to the names expected by the api a decision has to be made:

  1. use the names expected by the api (lowercase, underscore, ect.)
  2. Add extra names into the enum and use the Parameter attribute (in which case we can drop the Flags
  3. Update the parsing code

@shiftkey
Copy link

shiftkey commented Feb 5, 2016

@M-Zuber

Add extra names into the enum and use the Parameter attribute (in which case we can drop the Flags)

I like this option, as it feels like other places in the code. Do you think there'll be an issue with doing this here?

@M-Zuber
Copy link
Author

M-Zuber commented Feb 5, 2016

It's only three values so it shouldnt be a problem. I'll update the gist and ping you so you can update the issue back on the repo

@shiftkey
Copy link

shiftkey commented Feb 5, 2016

@M-Zuber 🆒

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment