On this page:
service?
discovery-document->service
local-discovery-document->service
online-discovery-document->service
method-proc

4 Dynamic

 (require (planet gh/gapi:1:=2/dynamic))

Another way to use the API discovery service is to query it at runtime, or to parse a locally-stored discovery file at runtime. This may be desirable if you want to be able to discover newly-added services, for example.

procedure

(service? v)  boolean?

  v : any/c
Returns #t if v is a service, #f otherwise.

A service? is a jsexpr? to which procedures have been added.

procedure

(discovery-document->service discovery-document)  service?

  discovery-document : jsexpr?
Create a service? object representing the web service defined by the JSON provided as a jsexpr?.

procedure

(local-discovery-document->service filename)  service?

  filename : (or/c symbol? path-string?)
Create a service? object representing the web service defined by the JSON file filename.

If filename is a symbol?, then the file is looked for in the vendor subdirectory of the PLaneT cache. (This is very roughly similar to doing a normal Racket require using a symbol vs. a string. The symbol version means, "look in a standard place".)

procedure

(online-discovery-document->service name    
  ver)  service?
  name : string?
  ver : string?
Create a service? object representing the web service defined by the name and version, which is fetched via HTTP from the Google API Discovery service.

procedure

(method-proc service    
  resource-name    
  method-name)  procedure?
  service : service?
  resource-name : symbol?
  method-name : symbol?
Given a service?, resource-name, and method-name, get a procedure that makes HTTP requests to the service.

The procedure returned by method-proc is like that created by require-gapi-doc; see that for more information.