Giter VIP home page Giter VIP logo

gh's People

Contributors

penland365 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

gh's Issues

Edit an organization

Endpoint

PATCH /orgs/:org.

Docs

Edit an organization API Documentation

Request

Parameters

Name Type Description
billing_email string Billing email address. This address is not publicized.
company string The company name.
email string The publicly visible email address.
location string The location.
name string The shorthand name of the company.
description string The description of the company.
has_organization_projects boolean Toggles whether organization projects are enabled for the organization.
has_repository_projects boolean Toggles whether repository projects are enabled for repositories that belong to the organization.
default_repository_permission boolean Default permission level members have for organization repositories: * read - can pull, but not push to or administer this repository. * write - can pull and push, but not administer this repository. * admin - can pull, push and administer this repository. * none - no permissions granted by default. Default: read
members_can_create_repositories boolean Toggles ability of non-admin organization members to create repositories * true - all organization members can create repositories. * false - only admin members can create repositories Default: true

Example JSON

{
  "billing_email": "[email protected]",
  "blog": "https://github.com/blog",
  "company": "GitHub",
  "email": "[email protected]",
  "location": "San Francisco",
  "name": "github",
  "description": "GitHub, the company.",
  "default_repository_permission": "read",
  "members_can_create_repositories": "true"
}

Response

200 OK

{
  "login": "github",
  "id": 1,
  "url": "https://api.github.com/orgs/github",
  "repos_url": "https://api.github.com/orgs/github/repos",
  "events_url": "https://api.github.com/orgs/github/events",
  "hooks_url": "https://api.github.com/orgs/github/hooks",
  "issues_url": "https://api.github.com/orgs/github/issues",
  "members_url": "https://api.github.com/orgs/github/members{/member}",
  "public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
  "avatar_url": "https://github.com/images/error/octocat_happy.gif",
  "description": "A great organization",
  "name": "github",
  "company": "GitHub",
  "blog": "https://github.com/blog",
  "location": "San Francisco",
  "email": "[email protected]",
  "public_repos": 2,
  "public_gists": 1,
  "followers": 20,
  "following": 0,
  "html_url": "https://github.com/octocat",
  "created_at": "2008-01-14T04:33:35Z",
  "type": "Organization",
  "total_private_repos": 100,
  "owned_private_repos": 100,
  "private_gists": 81,
  "disk_usage": 10000,
  "collaborators": 8,
  "billing_email": "[email protected]",
  "plan": {
    "name": "Medium",
    "space": 400,
    "private_repos": 20
  },
  "default_repository_settings": "read",
  "members_can_create_repositories": "true",
  "has_organization_projects": true,
  "has_repository_projects": true
}

Remove outside collaborator

Endpoint

DELETE /orgs/:org/outside_collaborators/:username.

Docs

Removing a user from this list will remove them from all the organization's repositories.

Remove outside collaborators API documentation

Response

HTTP Status Code

204 No Content

Response if user is a member of the organization

HTTP Status Code

422 Unprocessable Entity

JSON payload

{
  "message": "You cannot specify an organization member to remove as an outside collaborator.",
  "documentation_url": "https://developer.github.com/v3/orgs/outside_collaborators/#remove-outside-collaborator"
}

Single User

Get a single user from the API --> GET /users/:username

Get a Single User API Documentation

Example JSON Payload

{
  "login": "octocat",
  "id": 1,
  "avatar_url": "https://github.com/images/error/octocat_happy.gif",
  "gravatar_id": "",
  "url": "https://api.github.com/users/octocat",
  "html_url": "https://github.com/octocat",
  "followers_url": "https://api.github.com/users/octocat/followers",
  "following_url": "https://api.github.com/users/octocat/following{/other_user}",
  "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
  "organizations_url": "https://api.github.com/users/octocat/orgs",
  "repos_url": "https://api.github.com/users/octocat/repos",
  "events_url": "https://api.github.com/users/octocat/events{/privacy}",
  "received_events_url": "https://api.github.com/users/octocat/received_events",
  "type": "User",
  "site_admin": false,
  "name": "monalisa octocat",
  "company": "GitHub",
  "blog": "https://github.com/blog",
  "location": "San Francisco",
  "email": "[email protected]",
  "hireable": false,
  "bio": "There once was...",
  "public_repos": 2,
  "public_gists": 1,
  "followers": 20,
  "following": 0,
  "created_at": "2008-01-14T04:33:35Z",
  "updated_at": "2008-01-14T04:33:35Z",
  "total_private_repos": 100,
  "owned_private_repos": 100,
  "private_gists": 81,
  "disk_usage": 10000,
  "collaborators": 8,
  "two_factor_authentication": true,
  "plan": {
    "name": "Medium",
    "space": 400,
    "private_repos": 20,
    "collaborators": 0
  }
}

Convert member to outside collaborator

Endpoint

PUT /orgs/:org/outside_collaborators/:username.

Docs

When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see Converting an organization member to an outside collaborator.

Convert member to outsdie collaborator API documentation

Response

HTTP Status Code

204 No Content

Response if user is the last owner of the organization

HTTP Status Code

403 Forbidden

JSON payload

{
  "message": "Cannot convert the last owner to an outside collaborator",
  "documentation_url": "https://developer.github.com/v3/orgs/outside_collaborators/#convert-member-to-outside-collaborator"
}

Response if user is not a member of the organization

HTTP Status Code

403 Forbidden

{
  "message": "<user> is not a member of the <organization> organization.",
  "documentation_url": "https://developer.github.com/v3/orgs/outside_collaborators/#convert-member-to-outside-collaborator"
}

List user organizations

Endpoint

GET /users/:username/orgs.

Expected Response

200 OK

Docs

List public organization memberships for the specified user.

This method only lists public memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the List your organizations API instead.

List user organizations

Example JSON Response

[
  {
    "login": "github",
    "id": 1,
    "url": "https://api.github.com/orgs/github",
    "repos_url": "https://api.github.com/orgs/github/repos",
    "events_url": "https://api.github.com/orgs/github/events",
    "hooks_url": "https://api.github.com/orgs/github/hooks",
    "issues_url": "https://api.github.com/orgs/github/issues",
    "members_url": "https://api.github.com/orgs/github/members{/member}",
    "public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "description": "A great organization"
  }
]

Drop rust_curl for Hyper

Due to rust_curl's lack of DELETE and PATCH HTTP support, a change is needed to move over to hyper before we go to far down the path with rust_curl.

Hyper

Get the authenticated user

Endpoint

GET /user.

Docs

Get the authenticated user from the API

Example JSON Payload

{
  "login": "octocat",
  "id": 1,
  "avatar_url": "https://github.com/images/error/octocat_happy.gif",
  "gravatar_id": "",
  "url": "https://api.github.com/users/octocat",
  "html_url": "https://github.com/octocat",
  "followers_url": "https://api.github.com/users/octocat/followers",
  "following_url": "https://api.github.com/users/octocat/following{/other_user}",
  "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
  "organizations_url": "https://api.github.com/users/octocat/orgs",
  "repos_url": "https://api.github.com/users/octocat/repos",
  "events_url": "https://api.github.com/users/octocat/events{/privacy}",
  "received_events_url": "https://api.github.com/users/octocat/received_events",
  "type": "User",
  "site_admin": false,
  "name": "monalisa octocat",
  "company": "GitHub",
  "blog": "https://github.com/blog",
  "location": "San Francisco",
  "email": "[email protected]",
  "hireable": false,
  "bio": "There once was...",
  "public_repos": 2,
  "public_gists": 1,
  "followers": 20,
  "following": 0,
  "created_at": "2008-01-14T04:33:35Z",
  "updated_at": "2008-01-14T04:33:35Z",
  "total_private_repos": 100,
  "owned_private_repos": 100,
  "private_gists": 81,
  "disk_usage": 10000,
  "collaborators": 8,
  "two_factor_authentication": true,
  "plan": {
    "name": "Medium",
    "space": 400,
    "private_repos": 20,
    "collaborators": 0
  }
}

Setup Testing Pipeline

Set up a full testing pipeline. Includes CI server, one default Unit test, one default integration test, setting up GitHub to receive the status of the CI output.

Get an organization

Endpoint

GET /orgs/:org.

Docs

Note: Many Organization response values require the user making the request to be authenticated, an organization owner, and have the admin:org scope authorized.

Get an organization API Documentation

Response

200 OK

[
  {
    "login": "github",
    "id": 1,
    "url": "https://api.github.com/orgs/github",
    "repos_url": "https://api.github.com/orgs/github/repos",
    "events_url": "https://api.github.com/orgs/github/events",
    "hooks_url": "https://api.github.com/orgs/github/hooks",
    "issues_url": "https://api.github.com/orgs/github/issues",
    "members_url": "https://api.github.com/orgs/github/members{/member}",
    "public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "description": "A great organization"
  }
]

List your organizations

Endpoint

GET /user/orgs.

Expected Response

200 OK

Docs

List your organizations

Example JSON Payload

[
  {
    "login": "github",
    "id": 1,
    "url": "https://api.github.com/orgs/github",
    "repos_url": "https://api.github.com/orgs/github/repos",
    "events_url": "https://api.github.com/orgs/github/events",
    "hooks_url": "https://api.github.com/orgs/github/hooks",
    "issues_url": "https://api.github.com/orgs/github/issues",
    "members_url": "https://api.github.com/orgs/github/members{/member}",
    "public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "description": "A great organization"
  }
]

Update the authenticated user

Endpoint

PATCH /user

Expected response

200 OK

Docs

Patch the authenticated user

Parameters

Name Type Description
name string The new name of the user.
email string Publicly visible email address.
blog string The new blog URL of the user.
company string The new company of the user.
location string The new location of the user.
hireable boolean The new hiring availability of the user.
bio string The new short biography of the user.

Example JSON

{
  "name": "monalisa octocat",
  "email": "[email protected]",
  "blog": "https://github.com/blog",
  "company": "GitHub",
  "location": "San Francisco",
  "hireable": true,
  "bio": "There once..."
}

List outside collaborators

Endpoint

GET /orgs/:org/outside_collaborators.

Docs

List all users who are outside collaborators of an organization.

List outside collaborators API documentation

Request

Parameters

Name Type Description
filter string Filter the list of outside collaborators. Can be one of:
* 2fa_disabled: Outside collaborators without two-factor authentication enabled.
* all: All outside collaborators.
Default: all

Response

HTTP Status Code

200 OK

JSON payload

[
  {
    "login": "octocat",
    "id": 1,
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  }
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.