on develop help sign in
Merge pull request #15 from traytonwhite/genexamplereadme
f829c0fBrendan Hay
README.md+32
@@ -17,6 +17,38 @@ under heavy development and not intended for public consumption, caveat emptor!
17<img alt="Гоголь-моголь" height="261px;" src="https://upload.wikimedia.org/wikipedia/commons/c/c7/Kogel_mogel.JPG">
17<img alt="Гоголь-моголь" height="261px;" src="https://upload.wikimedia.org/wikipedia/commons/c/c7/Kogel_mogel.JPG">
18<img alt="Мико́ла Васи́льович Го́голь" height="261px" src="https://upload.wikimedia.org/wikipedia/commons/3/31/NV_Gogol.png">
18<img alt="Мико́ла Васи́льович Го́голь" height="261px" src="https://upload.wikimedia.org/wikipedia/commons/3/31/NV_Gogol.png">
19
19
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.
20
52
21## Contribute
53## Contribute
22
54