on develop help sign in
Add generate example to README
commitec60b022f5d0782fbae6811dad42f30e2a0b4daa authorTrayton White <tbw@traytonwhite.com> dateFri 19 Feb 2016, 14:38 (11 years ago) parentbe47a98
1 file changed+32
README.md+32
README.md+32
@@ -17,6 +17,38 @@ under heavy development and not intended for public consumption, caveat emptor!
1717<img alt="Гоголь-моголь" height="261px;" src="https://upload.wikimedia.org/wikipedia/commons/c/c7/Kogel_mogel.JPG">
1818<img alt="Мико́ла Васи́льович Го́голь" height="261px" src="https://upload.wikimedia.org/wikipedia/commons/3/31/NV_Gogol.png">
1919
20+## Generate New API Endpoints
21+
22+To generate new API endpoints, use the gogol/gen directory.
23+The key files in this directory (outside of the actual gogol-gen source!) are the annex files.
24+
25+To add a new endpoint, first create its annex file in the annex directory. It should be named after the API endpoint as found in the <a href="https://www.github.com/google/google-api-go-client">google/google-api-go-client repo.</a>
26+
27+### Example:
28+
29+#### Want to generate the Cloud Dataproc API endpoint
30+
31+The Cloud Dataproc API is called dataproc-api.json in the google repo. Create the file gogol/gen/annex/dataproc.json with these contents:
32+
33+```
34+{
35+ "library": "dataproc",
36+ "canonicalName": "Dataproc"
37+}
38+```
39+
40+From the gogol/gen directory, run:
41+
42+```
43+make clean
44+make
45+```
46+
47+This will build the gogol-gen executable, and then will generate all the API endpoints that have annex files.
48+
49+Once completed, there would then be a gogol-dataproc directory with its corresponding generated API client in the top-level directory of the repo.
50+
51+Note: rather than `make clean`, one could run `make full-clean` which removes all of the API references and causes redownload of the google-api-go-client repo.
2052
2153## Contribute
2254