Next: , Previous: , Up: API   [Contents][Index]


3.4 Github Convenience Wrappers

Function: ghub-head resource &optional params &key query payload headers unpaginate noerror reader username auth host callback errorback
Function: ghub-get resource &optional params &key query payload headers unpaginate noerror reader username auth host callback errorback

These functions are simple wrappers around ghub-request. Their signature is identical to that of the latter, except that they do not have an argument named METHOD. The HTTP method is instead given by the second word in the function name.

As described in the documentation for ghub-request, it depends on the used method whether the value of the PARAMS argument is used as the query or the payload. For the "HEAD" and "GET" methods it is used as the query.

Function: ghub-put resource &optional params &key query payload headers unpaginate noerror reader username auth host callback errorback
Function: ghub-post resource &optional params &key query payload headers unpaginate noerror reader username auth host callback errorback
Function: ghub-patch resource &optional params &key query payload headers unpaginate noerror reader username auth host callback errorback
Function: ghub-delete resource &optional params &key query payload headers unpaginate noerror reader username auth host callback errorback

These functions are simple wrappers around ghub-request. Their signature is identical to that of the latter, except that they do not have an argument named METHOD. The HTTP method is instead given by the second word in the function name.

As described in the documentation for ghub-request, it depends on the used method whether the value of the PARAMS argument is used as the query or the payload. For the "PUT", "POST", "PATCH" and "DELETE" methods it is used as the payload.

Function: ghub-wait resource &optional duration &key username auth host

Some API requests result in an immediate successful response even when the requested action has not actually been carried out yet. An example is the request for the creation of a new repository, which doesn’t cause the repository to immediately become available. The Github API documentation usually mentions this when describing an affected resource.

If you want to do something with some resource right after making a request for its creation, then you might have to wait for it to actually be created. This function can be used to do so. It repeatedly tries to access the resource until it becomes available or until a timeout is reached. In the latter case it signals ghub-error.

RESOURCE specifies the resource that this function waits for.

DURATION specifies the maximum number of seconds to wait for, defaulting to 64 seconds. Emacs will block during that time, but the user can abort using C-g.

The first attempt is made immediately and will often succeed. If not, then another attempt is made after two seconds, and each subsequent attempt is made after waiting as long as we already waited between all preceding attempts combined.

See ghub-request’s documentation above for information about the other arguments.


Next: Non-Github Convenience Wrappers, Previous: Making GraphQL Requests, Up: API   [Contents][Index]