From 7db4a2e3b2272362be43f9f7cd362140533ef9c4 Mon Sep 17 00:00:00 2001 From: Ian Barber Date: Sun, 2 Dec 2012 23:12:34 +0000 Subject: [PATCH] first commit --- NOTES.txt | 3 + README | 13 + data/apis.json | 1044 ++++++++++++++++++++++++++++++++ data/plus.json | 1263 +++++++++++++++++++++++++++++++++++++++ project.clj | 3 + src/gapi/core.clj | 41 ++ src/gapi/oauth.clj | 30 + test/gapi/test/core.clj | 6 + 8 files changed, 2403 insertions(+) create mode 100644 NOTES.txt create mode 100644 README create mode 100755 data/apis.json create mode 100755 data/plus.json create mode 100644 project.clj create mode 100644 src/gapi/core.clj create mode 100644 src/gapi/oauth.clj create mode 100644 test/gapi/test/core.clj diff --git a/NOTES.txt b/NOTES.txt new file mode 100644 index 0000000..858fc6d --- /dev/null +++ b/NOTES.txt @@ -0,0 +1,3 @@ +How is best to indicate private methods in clojure modules? +How do multimethods work? +Can we list everything in a namepsace? may be easier than keeping an atom \ No newline at end of file diff --git a/README b/README new file mode 100644 index 0000000..23d18bd --- /dev/null +++ b/README @@ -0,0 +1,13 @@ +# gapi + +FIXME: write description + +## Usage + +FIXME: write + +## License + +Copyright (C) 2012 FIXME + +Distributed under the Eclipse Public License, the same as Clojure. diff --git a/data/apis.json b/data/apis.json new file mode 100755 index 0000000..ac9416f --- /dev/null +++ b/data/apis.json @@ -0,0 +1,1044 @@ +{ + "kind": "discovery#directoryList", + "discoveryVersion": "v1", + "items": [ + { + "kind": "discovery#directoryItem", + "id": "adexchangebuyer:v1", + "name": "adexchangebuyer", + "version": "v1", + "title": "Ad Exchange Buyer API", + "description": "Lets you manage your Ad Exchange Buyer account.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adexchangebuyer/v1/rest", + "discoveryLink": "./apis/adexchangebuyer/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/buyer-rest", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "adexchangebuyer:v1.1", + "name": "adexchangebuyer", + "version": "v1.1", + "title": "Ad Exchange Buyer API", + "description": "Lets you manage your Ad Exchange Buyer account.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adexchangebuyer/v1.1/rest", + "discoveryLink": "./apis/adexchangebuyer/v1.1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/buyer-rest", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "adexchangeseller:v1", + "name": "adexchangeseller", + "version": "v1", + "title": "Ad Exchange Seller API", + "description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adexchangeseller/v1/rest", + "discoveryLink": "./apis/adexchangeseller/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/adsense/management/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "adsense:v1", + "name": "adsense", + "version": "v1", + "title": "AdSense Management API", + "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adsense/v1/rest", + "discoveryLink": "./apis/adsense/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/adsense-16.png", + "x32": "http://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/management/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "adsense:v1.1", + "name": "adsense", + "version": "v1.1", + "title": "AdSense Management API", + "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adsense/v1.1/rest", + "discoveryLink": "./apis/adsense/v1.1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/adsense-16.png", + "x32": "http://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/management/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "adsense:v1.2", + "name": "adsense", + "version": "v1.2", + "title": "AdSense Management API", + "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adsense/v1.2/rest", + "discoveryLink": "./apis/adsense/v1.2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/adsense-16.png", + "x32": "http://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/management/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "adsensehost:v4.1", + "name": "adsensehost", + "version": "v4.1", + "title": "AdSense Host API", + "description": "Gives AdSense Hosts access to report generation, ad code generation, and publisher management capabilities.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adsensehost/v4.1/rest", + "discoveryLink": "./apis/adsensehost/v4.1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/adsense-16.png", + "x32": "http://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/host/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "analytics:v2.4preprod", + "name": "analytics", + "version": "v2.4preprod", + "title": "Google Analytics API", + "description": "View and manage your Google Analytics data", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/analytics/v2.4preprod/rest", + "discoveryLink": "./apis/analytics/v2.4preprod/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/analytics-16.png", + "x32": "http://www.google.com/images/icons/product/analytics-32.png" + }, + "documentationLink": "https://developers.google.com/analytics/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "analytics:v3alphapreprod", + "name": "analytics", + "version": "v3alphapreprod", + "title": "Google Analytics API - Alpha Version", + "description": "View and manage your Google Analytics data", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/analytics/v3alphapreprod/rest", + "discoveryLink": "./apis/analytics/v3alphapreprod/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/analytics-16.png", + "x32": "http://www.google.com/images/icons/product/analytics-32.png" + }, + "documentationLink": "https://developers.google.com/analytics/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "analytics:v3internalpreprod", + "name": "analytics", + "version": "v3internalpreprod", + "title": "Google Analytics API", + "description": "View and manage your Google Analytics data", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/analytics/v3internalpreprod/rest", + "discoveryLink": "./apis/analytics/v3internalpreprod/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/analytics-16.png", + "x32": "http://www.google.com/images/icons/product/analytics-32.png" + }, + "documentationLink": "https://developers.google.com/analytics/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "analytics:v3preprod", + "name": "analytics", + "version": "v3preprod", + "title": "Google Analytics API", + "description": "View and manage your Google Analytics data", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/analytics/v3preprod/rest", + "discoveryLink": "./apis/analytics/v3preprod/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/analytics-16.png", + "x32": "http://www.google.com/images/icons/product/analytics-32.png" + }, + "documentationLink": "https://developers.google.com/analytics/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "analytics:v2.4", + "name": "analytics", + "version": "v2.4", + "title": "Google Analytics API", + "description": "View and manage your Google Analytics data", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/analytics/v2.4/rest", + "discoveryLink": "./apis/analytics/v2.4/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/analytics-16.png", + "x32": "http://www.google.com/images/icons/product/analytics-32.png" + }, + "documentationLink": "https://developers.google.com/analytics/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "analytics:v3", + "name": "analytics", + "version": "v3", + "title": "Google Analytics API", + "description": "View and manage your Google Analytics data", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/analytics/v3/rest", + "discoveryLink": "./apis/analytics/v3/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/analytics-16.png", + "x32": "http://www.google.com/images/icons/product/analytics-32.png" + }, + "documentationLink": "https://developers.google.com/analytics/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "androidpublisher:v1", + "name": "androidpublisher", + "version": "v1", + "title": "Google Play Android Developer API", + "description": "Lets Android application developers access their Google Play accounts.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/androidpublisher/v1/rest", + "discoveryLink": "./apis/androidpublisher/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/android-16.png", + "x32": "http://www.google.com/images/icons/product/android-32.png" + }, + "documentationLink": "https://developers.google.com/android-publisher", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "audit:v1", + "name": "audit", + "version": "v1", + "title": "Enterprise Audit API", + "description": "Lets you access user activities in your enterprise made through various applications.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/audit/v1/rest", + "discoveryLink": "./apis/audit/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "http://code.google.com/googleapps/domain/audit_admin/v1/getting_started.html", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "bigquery:v2", + "name": "bigquery", + "version": "v2", + "title": "BigQuery API", + "description": "A data platform for customers to create, manage, share and query data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/bigquery/v2/rest", + "discoveryLink": "./apis/bigquery/v2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/bigquery/docs/overview", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "blogger:v2", + "name": "blogger", + "version": "v2", + "title": "Blogger API", + "description": "API for access to the data within Blogger.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/blogger/v2/rest", + "discoveryLink": "./apis/blogger/v2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/blogger-16.png", + "x32": "http://www.google.com/images/icons/product/blogger-32.png" + }, + "documentationLink": "https://developers.google.com/blogger/docs/2.0/json/getting_started", + "labels": [ + "limited_availability" + ], + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "blogger:v3", + "name": "blogger", + "version": "v3", + "title": "Blogger API", + "description": "API for access to the data within Blogger.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/blogger/v3/rest", + "discoveryLink": "./apis/blogger/v3/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/blogger-16.png", + "x32": "http://www.google.com/images/icons/product/blogger-32.png" + }, + "documentationLink": "https://developers.google.com/blogger/docs/3.0/getting_started", + "labels": [ + "limited_availability" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "books:v1", + "name": "books", + "version": "v1", + "title": "Books API", + "description": "Lets you search for books and manage your Google Books library.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/books/v1/rest", + "discoveryLink": "./apis/books/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/ebooks-16.png", + "x32": "http://www.google.com/images/icons/product/ebooks-32.png" + }, + "documentationLink": "https://developers.google.com/books/docs/v1/getting_started", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "calendar:v3", + "name": "calendar", + "version": "v3", + "title": "Calendar API", + "description": "Lets you manipulate events and other calendar data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest", + "discoveryLink": "./apis/calendar/v3/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/calendar-16.png", + "x32": "http://www.google.com/images/icons/product/calendar-32.png" + }, + "documentationLink": "https://developers.google.com/google-apps/calendar/firstapp", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "civicinfo:us_v1", + "name": "civicinfo", + "version": "us_v1", + "title": "Google Civic Information API", + "description": "An API for accessing civic information.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/civicinfo/us_v1/rest", + "discoveryLink": "./apis/civicinfo/us_v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/civic-information", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "compute:v1beta12", + "name": "compute", + "version": "v1beta12", + "title": "Compute Engine API", + "description": "API for the Google Compute Engine service.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/compute/v1beta12/rest", + "discoveryLink": "./apis/compute/v1beta12/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "http://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://developers.google.com/compute/docs/reference/v1beta12", + "labels": [ + "limited_availability" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "coordinate:v1", + "name": "coordinate", + "version": "v1", + "title": "Google Maps Coordinate API", + "description": "Lets you view and manage jobs in a Coordinate team.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/coordinate/v1/rest", + "discoveryLink": "./apis/coordinate/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/coordinate/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "customsearch:v1", + "name": "customsearch", + "version": "v1", + "title": "CustomSearch API", + "description": "Lets you search over a website or collection of websites", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/customsearch/v1/rest", + "discoveryLink": "./apis/customsearch/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/custom-search/v1/using_rest", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "dfareporting:v1", + "name": "dfareporting", + "version": "v1", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/dfareporting/v1/rest", + "discoveryLink": "./apis/dfareporting/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "dfareporting:v1.1", + "name": "dfareporting", + "version": "v1.1", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/dfareporting/v1.1/rest", + "discoveryLink": "./apis/dfareporting/v1.1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "http://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "discovery:v1", + "name": "discovery", + "version": "v1", + "title": "APIs Discovery Service", + "description": "Lets you discover information about other Google APIs, such as what APIs are available, the resource and method details for each API", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/discovery/v1/rest", + "discoveryLink": "./apis/discovery/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/feature/filing_cabinet_search-g16.png", + "x32": "http://www.google.com/images/icons/feature/filing_cabinet_search-g32.png" + }, + "documentationLink": "https://developers.google.com/discovery/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "drive:v2.1beta", + "name": "drive", + "version": "v2.1beta", + "title": "Drive API", + "description": "The API to interact with Drive.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/drive/v2.1beta/rest", + "discoveryLink": "./apis/drive/v2.1beta/rest", + "icons": { + "x16": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_16.png", + "x32": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_32.png" + }, + "documentationLink": "https://developers.google.com/drive/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "drive:v1", + "name": "drive", + "version": "v1", + "title": "Drive API", + "description": "The API to interact with Drive.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/drive/v1/rest", + "discoveryLink": "./apis/drive/v1/rest", + "icons": { + "x16": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_16.png", + "x32": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_32.png" + }, + "documentationLink": "https://developers.google.com/drive/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "drive:v2", + "name": "drive", + "version": "v2", + "title": "Drive API", + "description": "The API to interact with Drive.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/drive/v2/rest", + "discoveryLink": "./apis/drive/v2/rest", + "icons": { + "x16": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_16.png", + "x32": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_32.png" + }, + "documentationLink": "https://developers.google.com/drive/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "freebase:v1sandbox", + "name": "freebase", + "version": "v1sandbox", + "title": "Freebase API", + "description": "Lets you access the Freebase repository of open data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/freebase/v1sandbox/rest", + "discoveryLink": "./apis/freebase/v1sandbox/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/freebase-16.png", + "x32": "http://www.google.com/images/icons/product/freebase-32.png" + }, + "documentationLink": "http://wiki.freebase.com/wiki/API", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "freebase:v1", + "name": "freebase", + "version": "v1", + "title": "Freebase API", + "description": "Lets you access the Freebase repository of open data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/freebase/v1/rest", + "discoveryLink": "./apis/freebase/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/freebase-16.png", + "x32": "http://www.google.com/images/icons/product/freebase-32.png" + }, + "documentationLink": "http://wiki.freebase.com/wiki/API", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "fusiontables:v1", + "name": "fusiontables", + "version": "v1", + "title": "Fusion Tables API", + "description": "API for working with Fusion Tables data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/fusiontables/v1/rest", + "discoveryLink": "./apis/fusiontables/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/fusiontables", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "gan:v1beta1", + "name": "gan", + "version": "v1beta1", + "title": "Google Affiliate Network API", + "description": "Lets you have programmatic access to your Google Affiliate Network data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/gan/v1beta1/rest", + "discoveryLink": "./apis/gan/v1beta1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/affiliatenetwork-16.png", + "x32": "http://www.google.com/images/icons/product/affiliatenetwork-32.png" + }, + "documentationLink": "https://developers.google.com/affiliate-network/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "groupssettings:v1", + "name": "groupssettings", + "version": "v1", + "title": "Groups Settings API", + "description": "Lets you manage permission levels and related settings of a group.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/groupssettings/v1/rest", + "discoveryLink": "./apis/groupssettings/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/google-apps/groups-settings/get_started", + "labels": [ + "limited_availability" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "latitude:v1", + "name": "latitude", + "version": "v1", + "title": "Google Latitude API", + "description": "Lets you read and update your current location and work with your location history", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/latitude/v1/rest", + "discoveryLink": "./apis/latitude/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/latitude/v1/using", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "licensing:v1", + "name": "licensing", + "version": "v1", + "title": "Enterprise License Manager API", + "description": "Licensing API to view and manage license for your domain.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/licensing/v1/rest", + "discoveryLink": "./apis/licensing/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/google-apps/licensing/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "moderator:v1", + "name": "moderator", + "version": "v1", + "title": "Moderator API", + "description": "Moderator API", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/moderator/v1/rest", + "discoveryLink": "./apis/moderator/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/moderator-32.png", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "http://code.google.com/apis/moderator/v1/using_rest.html", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "oauth2:v1", + "name": "oauth2", + "version": "v1", + "title": "Google OAuth2 API", + "description": "Lets you access OAuth2 protocol related APIs.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/oauth2/v1/rest", + "discoveryLink": "./apis/oauth2/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/accounts/docs/OAuth2", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "oauth2:v2", + "name": "oauth2", + "version": "v2", + "title": "Google OAuth2 API", + "description": "Lets you access OAuth2 protocol related APIs.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/oauth2/v2/rest", + "discoveryLink": "./apis/oauth2/v2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/accounts/docs/OAuth2", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "orkut:v2", + "name": "orkut", + "version": "v2", + "title": "Orkut API", + "description": "Lets you manage activities, comments and badges in Orkut. More stuff coming in time.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/orkut/v2/rest", + "discoveryLink": "./apis/orkut/v2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/orkut-16.png", + "x32": "http://www.google.com/images/icons/product/orkut-32.png" + }, + "documentationLink": "http://code.google.com/apis/orkut/v2/reference.html", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "pagespeedonline:v1", + "name": "pagespeedonline", + "version": "v1", + "title": "Page Speed Online API", + "description": "Lets you analyze the performance of a web page and get tailored suggestions to make that page faster.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/pagespeedonline/v1/rest", + "discoveryLink": "./apis/pagespeedonline/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/pagespeed-16.png", + "x32": "http://www.google.com/images/icons/product/pagespeed-32.png" + }, + "documentationLink": "https://developers.google.com/speed/docs/insights/v1/getting_started", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "plus:v1moments", + "name": "plus", + "version": "v1moments", + "title": "Google+ API", + "description": "The Google+ API enables developers to build on top of the Google+ platform.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/plus/v1moments/rest", + "discoveryLink": "./apis/plus/v1moments/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/gplus-16.png", + "x32": "http://www.google.com/images/icons/product/gplus-32.png" + }, + "documentationLink": "https://developers.google.com/+/history/", + "labels": [ + "limited_availability" + ], + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "plus:v1", + "name": "plus", + "version": "v1", + "title": "Google+ API", + "description": "The Google+ API enables developers to build on top of the Google+ platform.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/plus/v1/rest", + "discoveryLink": "./apis/plus/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/gplus-16.png", + "x32": "http://www.google.com/images/icons/product/gplus-32.png" + }, + "documentationLink": "https://developers.google.com/+/api/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "prediction:v1.2", + "name": "prediction", + "version": "v1.2", + "title": "Prediction API", + "description": "Lets you access a cloud hosted machine learning service that makes it easy to build smart apps", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/prediction/v1.2/rest", + "discoveryLink": "./apis/prediction/v1.2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/feature/predictionapi-16.png", + "x32": "http://www.google.com/images/icons/feature/predictionapi-32.png" + }, + "documentationLink": "https://developers.google.com/prediction/docs/developer-guide", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "prediction:v1.3", + "name": "prediction", + "version": "v1.3", + "title": "Prediction API", + "description": "Lets you access a cloud hosted machine learning service that makes it easy to build smart apps", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/prediction/v1.3/rest", + "discoveryLink": "./apis/prediction/v1.3/rest", + "icons": { + "x16": "http://www.google.com/images/icons/feature/predictionapi-16.png", + "x32": "http://www.google.com/images/icons/feature/predictionapi-32.png" + }, + "documentationLink": "https://developers.google.com/prediction/docs/developer-guide", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "prediction:v1.4", + "name": "prediction", + "version": "v1.4", + "title": "Prediction API", + "description": "Lets you access a cloud hosted machine learning service that makes it easy to build smart apps", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/prediction/v1.4/rest", + "discoveryLink": "./apis/prediction/v1.4/rest", + "icons": { + "x16": "http://www.google.com/images/icons/feature/predictionapi-16.png", + "x32": "http://www.google.com/images/icons/feature/predictionapi-32.png" + }, + "documentationLink": "https://developers.google.com/prediction/docs/developer-guide", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "prediction:v1.5", + "name": "prediction", + "version": "v1.5", + "title": "Prediction API", + "description": "Lets you access a cloud hosted machine learning service that makes it easy to build smart apps", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/prediction/v1.5/rest", + "discoveryLink": "./apis/prediction/v1.5/rest", + "icons": { + "x16": "http://www.google.com/images/icons/feature/predictionapi-16.png", + "x32": "http://www.google.com/images/icons/feature/predictionapi-32.png" + }, + "documentationLink": "https://developers.google.com/prediction/docs/developer-guide", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "reportcard:v1", + "name": "reportcard", + "version": "v1", + "title": "Dashboard Reporting (Reportcard) API", + "description": "Reportcard is an internal tool for serving non-critical notices to engineers and application developers.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/reportcard/v1/rest", + "discoveryLink": "./apis/reportcard/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "http://goto.google.com/reportcard", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "reseller:v1sandbox", + "name": "reseller", + "version": "v1sandbox", + "title": "Enterprise Apps Reseller API", + "description": "Lets you create and manage your customers and their subscriptions.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/reseller/v1sandbox/rest", + "discoveryLink": "./apis/reseller/v1sandbox/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/google-apps/reseller/", + "labels": [ + "limited_availability" + ], + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "reseller:v1", + "name": "reseller", + "version": "v1", + "title": "Enterprise Apps Reseller API", + "description": "Lets you create and manage your customers and their subscriptions.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/reseller/v1/rest", + "discoveryLink": "./apis/reseller/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/google-apps/reseller/", + "labels": [ + "limited_availability" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "shopping:v1", + "name": "shopping", + "version": "v1", + "title": "Search API For Shopping", + "description": "Lets you search over product data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/shopping/v1/rest", + "discoveryLink": "./apis/shopping/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/shopping-search/v1/getting_started", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "siteVerification:v1", + "name": "siteVerification", + "version": "v1", + "title": "Google Site Verification API", + "description": "Lets you programatically verify ownership of websites or domains with Google.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/siteVerification/v1/rest", + "discoveryLink": "./apis/siteVerification/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "http://code.google.com/apis/siteverification/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "storage:v1beta1", + "name": "storage", + "version": "v1beta1", + "title": "Cloud Storage API", + "description": "Lets you store and retrieve potentially-large, immutable data objects.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/storage/v1beta1/rest", + "discoveryLink": "./apis/storage/v1beta1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png", + "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png" + }, + "documentationLink": "https://developers.google.com/storage/docs/json_api/", + "labels": [ + "limited_availability" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "taskqueue:v1beta1", + "name": "taskqueue", + "version": "v1beta1", + "title": "TaskQueue API", + "description": "Lets you access a Google App Engine Pull Task Queue over REST.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/taskqueue/v1beta1/rest", + "discoveryLink": "./apis/taskqueue/v1beta1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/app_engine-16.png", + "x32": "http://www.google.com/images/icons/product/app_engine-32.png" + }, + "documentationLink": "http://code.google.com/appengine/docs/python/taskqueue/rest.html", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "taskqueue:v1beta2", + "name": "taskqueue", + "version": "v1beta2", + "title": "TaskQueue API", + "description": "Lets you access a Google App Engine Pull Task Queue over REST.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/taskqueue/v1beta2/rest", + "discoveryLink": "./apis/taskqueue/v1beta2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/app_engine-16.png", + "x32": "http://www.google.com/images/icons/product/app_engine-32.png" + }, + "documentationLink": "http://code.google.com/appengine/docs/python/taskqueue/rest.html", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "tasks:v1", + "name": "tasks", + "version": "v1", + "title": "Tasks API", + "description": "Lets you manage your tasks and task lists.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/tasks/v1/rest", + "discoveryLink": "./apis/tasks/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/tasks-16.png", + "x32": "http://www.google.com/images/icons/product/tasks-32.png" + }, + "documentationLink": "http://code.google.com/apis/tasks/v1/using.html", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "translate:v2", + "name": "translate", + "version": "v2", + "title": "Translate API", + "description": "Lets you translate text from one language to another", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/translate/v2/rest", + "discoveryLink": "./apis/translate/v2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/translate-16.png", + "x32": "http://www.google.com/images/icons/product/translate-32.png" + }, + "documentationLink": "http://code.google.com/apis/language/translate/v2/using_rest.html", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "urlshortener:v1", + "name": "urlshortener", + "version": "v1", + "title": "URL Shortener API", + "description": "Lets you create, inspect, and manage goo.gl short URLs", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/urlshortener/v1/rest", + "discoveryLink": "./apis/urlshortener/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "http://code.google.com/apis/urlshortener/v1/getting_started.html", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "webfonts:v1", + "name": "webfonts", + "version": "v1", + "title": "Google Web Fonts Developer API", + "description": "The Google Web Fonts Developer API.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/webfonts/v1/rest", + "discoveryLink": "./apis/webfonts/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/feature/font_api-16.png", + "x32": "http://www.google.com/images/icons/feature/font_api-32.gif" + }, + "documentationLink": "http://code.google.com/apis/webfonts/docs/developer_api.html", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "youtube:v3", + "name": "youtube", + "version": "v3", + "title": "YouTube API", + "description": "Programmatic access to YouTube features.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest", + "discoveryLink": "./apis/youtube/v3/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/youtube-16.png", + "x32": "http://www.google.com/images/icons/product/youtube-32.png" + }, + "documentationLink": "https://developers.google.com/youtube", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "youtubeAnalytics:v1", + "name": "youtubeAnalytics", + "version": "v1", + "title": "YouTube Analytics API", + "description": "Retrieve your YouTube Analytics reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/youtubeAnalytics/v1/rest", + "discoveryLink": "./apis/youtubeAnalytics/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/youtube-16.png", + "x32": "http://www.google.com/images/icons/product/youtube-32.png" + }, + "documentationLink": "http://developers.google.com/youtube/analytics/", + "labels": [ + "graduated" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "youtubeAnalytics:v1beta1", + "name": "youtubeAnalytics", + "version": "v1beta1", + "title": "YouTube Analytics API", + "description": "Retrieve your YouTube Analytics reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/youtubeAnalytics/v1beta1/rest", + "discoveryLink": "./apis/youtubeAnalytics/v1beta1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/youtube-16.png", + "x32": "http://www.google.com/images/icons/product/youtube-32.png" + }, + "documentationLink": "http://developers.google.com/youtube/analytics/", + "labels": [ + "graduated" + ], + "preferred": false + } + ] +} \ No newline at end of file diff --git a/data/plus.json b/data/plus.json new file mode 100755 index 0000000..747f333 --- /dev/null +++ b/data/plus.json @@ -0,0 +1,1263 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"oZqOFf-aKzMvpID-BwBAFJLe7Pk/sKOWQzkdEBleXJA46F4mcUS7L30\"", + "discoveryVersion": "v1", + "id": "plus:v1", + "name": "plus", + "version": "v1", + "revision": "20120806", + "title": "Google+ API", + "description": "The Google+ API enables developers to build on top of the Google+ platform.", + "icons": { + "x16": "http://www.google.com/images/icons/product/gplus-16.png", + "x32": "http://www.google.com/images/icons/product/gplus-32.png" + }, + "documentationLink": "https://developers.google.com/+/api/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/plus/v1/", + "basePath": "/plus/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "plus/v1/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/plus.me": { + "description": "Know who you are on Google" + } + } + } + }, + "schemas": { + "Acl": { + "id": "Acl", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Description of the access granted, suitable for display." + }, + "items": { + "type": "array", + "description": "The list of access entries.", + "items": { + "$ref": "PlusAclentryResource" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of access controls. Value: \"plus#acl\".", + "default": "plus#acl" + } + } + }, + "Activity": { + "id": "Activity", + "type": "object", + "properties": { + "access": { + "$ref": "Acl", + "description": "Identifies who has access to see this activity." + }, + "actor": { + "type": "object", + "description": "The person who performed this activity.", + "properties": { + "displayName": { + "type": "string", + "description": "The name of the actor, suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the actor's person resource." + }, + "image": { + "type": "object", + "description": "The image representation of the actor.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the actor's profile photo. To re-size the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "name": { + "type": "object", + "description": "An object representation of the individual components of name.", + "properties": { + "familyName": { + "type": "string", + "description": "The family name (last name) of the actor." + }, + "givenName": { + "type": "string", + "description": "The given name (first name) of the actor." + } + } + }, + "url": { + "type": "string", + "description": "The link to the actor's Google profile." + } + } + }, + "address": { + "type": "string", + "description": "Street address where this activity occurred." + }, + "annotation": { + "type": "string", + "description": "Additional content added by the person who shared this activity, applicable only when resharing an activity." + }, + "crosspostSource": { + "type": "string", + "description": "If this activity is a crosspost from another system, this property specifies the ID of the original activity." + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "geocode": { + "type": "string", + "description": "Latitude and longitude where this activity occurred. Format is latitude followed by longitude, space separated." + }, + "id": { + "type": "string", + "description": "The ID of this activity." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as an activity. Value: \"plus#activity\".", + "default": "plus#activity" + }, + "object": { + "type": "object", + "description": "The object of this activity.", + "properties": { + "actor": { + "type": "object", + "description": "If this activity's object is itself another activity (for example, when a person reshares an activity), this property specifies the original activity's actor.", + "properties": { + "displayName": { + "type": "string", + "description": "The original actor's name, suitable for display." + }, + "id": { + "type": "string", + "description": "ID of the original actor." + }, + "image": { + "type": "object", + "description": "The image representation of the original actor.", + "properties": { + "url": { + "type": "string", + "description": "A URL that points to a thumbnail photo of the original actor." + } + } + }, + "url": { + "type": "string", + "description": "A link to the original actor's Google profile." + } + } + }, + "attachments": { + "type": "array", + "description": "The media objects attached to this activity.", + "items": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "If the attachment is an article, this property contains a snippet of text from the article. It can also include descriptions for other types." + }, + "displayName": { + "type": "string", + "description": "The title of the attachment (such as a photo caption or an article title)." + }, + "embed": { + "type": "object", + "description": "If the attachment is a video, the embeddable link.", + "properties": { + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "URL of the link." + } + } + }, + "fullImage": { + "type": "object", + "description": "The full image URL for photo attachments.", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the linked resource.", + "format": "uint32" + }, + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "URL to the image." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the linked resource.", + "format": "uint32" + } + } + }, + "id": { + "type": "string", + "description": "The ID of the attachment." + }, + "image": { + "type": "object", + "description": "The preview image for photos or videos.", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the linked resource.", + "format": "uint32" + }, + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "Image url." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the linked resource.", + "format": "uint32" + } + } + }, + "objectType": { + "type": "string", + "description": "The type of media object. Possible values are: \n- \"photo\" - A photo. \n- \"album\" - A photo album. \n- \"video\" - A video. \n- \"article\" - An article, specified by a link." + }, + "thumbnails": { + "type": "array", + "description": "If the attachment is an album, potential additional thumbnails from the album.", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Potential name of the thumbnail." + }, + "image": { + "type": "object", + "description": "Image resource.", + "properties": { + "height": { + "type": "integer", + "description": "The height, in pixels, of the linked resource.", + "format": "uint32" + }, + "type": { + "type": "string", + "description": "Media type of the link." + }, + "url": { + "type": "string", + "description": "Image url." + }, + "width": { + "type": "integer", + "description": "The width, in pixels, of the linked resource.", + "format": "uint32" + } + } + }, + "url": { + "type": "string", + "description": "URL to the webpage containing the image." + } + } + } + }, + "url": { + "type": "string", + "description": "The link to the attachment, should be of type text/html." + } + } + } + }, + "content": { + "type": "string", + "description": "The HTML-formatted content, suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the object. When resharing an activity, this is the ID of the activity being reshared." + }, + "objectType": { + "type": "string", + "description": "The type of the object. Possible values are: \n- \"note\" - Textual content. \n- \"activity\" - A Google+ activity." + }, + "originalContent": { + "type": "string", + "description": "The content (text) as provided by the author, stored without any HTML formatting. When creating or updating an activity, this value must be supplied as plain text in the request." + }, + "plusoners": { + "type": "object", + "description": "People who +1'd this activity.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL for the collection of people who +1'd this activity." + }, + "totalItems": { + "type": "integer", + "description": "Total number of people who +1'd this activity.", + "format": "uint32" + } + } + }, + "replies": { + "type": "object", + "description": "Comments in reply to this activity.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL for the collection of comments in reply to this activity." + }, + "totalItems": { + "type": "integer", + "description": "Total number of comments on this activity.", + "format": "uint32" + } + } + }, + "resharers": { + "type": "object", + "description": "People who reshared this activity.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL for the collection of resharers." + }, + "totalItems": { + "type": "integer", + "description": "Total number of people who reshared this activity.", + "format": "uint32" + } + } + }, + "url": { + "type": "string", + "description": "The URL that points to the linked resource." + } + } + }, + "placeId": { + "type": "string", + "description": "ID of the place where this activity occurred." + }, + "placeName": { + "type": "string", + "description": "Name of the place where this activity occurred." + }, + "provider": { + "type": "object", + "description": "The service provider that initially published this activity.", + "properties": { + "title": { + "type": "string", + "description": "Name of the service provider." + } + } + }, + "published": { + "type": "string", + "description": "The time at which this activity was initially published. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "radius": { + "type": "string", + "description": "Radius, in meters, of the region where this activity occurred, centered at the latitude and longitude identified in geocode." + }, + "title": { + "type": "string", + "description": "Title of this activity." + }, + "updated": { + "type": "string", + "description": "The time at which this activity was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "url": { + "type": "string", + "description": "The link to this activity." + }, + "verb": { + "type": "string", + "description": "This activity's verb, indicating what action was performed. Possible values are: \n- \"checkin\" - Check in to a location. \n- \"post\" - Publish content to the stream. \n- \"share\" - Reshare an activity." + } + } + }, + "ActivityFeed": { + "id": "ActivityFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of this collection of activities." + }, + "items": { + "type": "array", + "description": "The activities in this page of results.", + "items": { + "$ref": "Activity" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of activities. Value: \"plus#activityFeed\".", + "default": "plus#activityFeed" + }, + "nextLink": { + "type": "string", + "description": "Link to the next page of activities." + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "selfLink": { + "type": "string", + "description": "Link to this activity resource." + }, + "title": { + "type": "string", + "description": "The title of this collection of activities." + }, + "updated": { + "type": "string", + "description": "The time at which this collection of activities was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + } + } + }, + "Comment": { + "id": "Comment", + "type": "object", + "properties": { + "actor": { + "type": "object", + "description": "The person who posted this comment.", + "properties": { + "displayName": { + "type": "string", + "description": "The name of this actor, suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the actor." + }, + "image": { + "type": "object", + "description": "The image representation of this actor.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the actor's profile photo. To re-size the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "url": { + "type": "string", + "description": "A link to the person resource for this actor." + } + } + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of this comment." + }, + "inReplyTo": { + "type": "array", + "description": "The activity this comment replied to.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the activity." + }, + "url": { + "type": "string", + "description": "The URL of the activity." + } + } + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a comment. Value: \"plus#comment\".", + "default": "plus#comment" + }, + "object": { + "type": "object", + "description": "The object of this comment.", + "properties": { + "content": { + "type": "string", + "description": "The HTML-formatted content, suitable for display." + }, + "objectType": { + "type": "string", + "description": "The object type of this comment. Possible values are: \n- \"comment\" - A comment in reply to an activity.", + "default": "comment" + }, + "originalContent": { + "type": "string", + "description": "The content (text) as provided by the author, stored without any HTML formatting. When creating or updating a comment, this value must be supplied as plain text in the request." + } + } + }, + "plusoners": { + "type": "object", + "description": "People who +1'd this comment.", + "properties": { + "totalItems": { + "type": "integer", + "description": "Total number of people who +1'd this comment.", + "format": "uint32" + } + } + }, + "published": { + "type": "string", + "description": "The time at which this comment was initially published. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "selfLink": { + "type": "string", + "description": "Link to this comment resource." + }, + "updated": { + "type": "string", + "description": "The time at which this comment was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + }, + "verb": { + "type": "string", + "description": "This comment's verb, indicating what action was performed. Possible values are: \n- \"post\" - Publish content to the stream.", + "default": "post" + } + } + }, + "CommentFeed": { + "id": "CommentFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "id": { + "type": "string", + "description": "The ID of this collection of comments." + }, + "items": { + "type": "array", + "description": "The comments in this page of results.", + "items": { + "$ref": "Comment" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of comments. Value: \"plus#commentFeed\".", + "default": "plus#commentFeed" + }, + "nextLink": { + "type": "string", + "description": "Link to the next page of activities." + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "title": { + "type": "string", + "description": "The title of this collection of comments." + }, + "updated": { + "type": "string", + "description": "The time at which this collection of comments was last updated. Formatted as an RFC 3339 timestamp.", + "format": "date-time" + } + } + }, + "PeopleFeed": { + "id": "PeopleFeed", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The people in this page of results. Each item includes the id, displayName, image, and url for the person. To retrieve additional profile data, see the people.get method.", + "items": { + "$ref": "Person" + } + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a collection of people. Value: \"plus#peopleFeed\".", + "default": "plus#peopleFeed" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "selfLink": { + "type": "string", + "description": "Link to this resource." + }, + "title": { + "type": "string", + "description": "The title of this collection of people." + }, + "totalItems": { + "type": "integer", + "description": "The total number of people available in this list. The number of people in a response might be smaller due to paging. This might not be set for all collections.", + "format": "int32" + } + } + }, + "Person": { + "id": "Person", + "type": "object", + "properties": { + "aboutMe": { + "type": "string", + "description": "A short biography for this person." + }, + "birthday": { + "type": "string", + "description": "The person's date of birth, represented as YYYY-MM-DD." + }, + "currentLocation": { + "type": "string", + "description": "The current location for this person." + }, + "displayName": { + "type": "string", + "description": "The name of this person, suitable for display." + }, + "emails": { + "type": "array", + "description": "A list of email addresses for this person.", + "items": { + "type": "object", + "properties": { + "primary": { + "type": "boolean", + "description": "If \"true\", indicates this email address is the person's primary one." + }, + "type": { + "type": "string", + "description": "The type of address. Possible values are: \n- \"home\" - Home email address. \n- \"work\" - Work email address. \n- \"other\" - Other." + }, + "value": { + "type": "string", + "description": "The email address." + } + } + } + }, + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "gender": { + "type": "string", + "description": "The person's gender. Possible values are: \n- \"male\" - Male gender. \n- \"female\" - Female gender. \n- \"other\" - Other." + }, + "hasApp": { + "type": "boolean", + "description": "If \"true\", indicates that the person has installed the app that is making the request and has chosen to expose this install state to the caller. A value of \"false\" indicates that the install state cannot be determined (it is either not installed or the person has chosen to keep this information private)." + }, + "id": { + "type": "string", + "description": "The ID of this person." + }, + "image": { + "type": "object", + "description": "The representation of the person's profile photo.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the person's profile photo. To re-size the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side." + } + } + }, + "isPlusUser": { + "type": "boolean", + "description": "Whether this user has signed up for G+." + }, + "kind": { + "type": "string", + "description": "Identifies this resource as a person. Value: \"plus#person\".", + "default": "plus#person" + }, + "name": { + "type": "object", + "description": "An object representation of the individual components of a person's name.", + "properties": { + "familyName": { + "type": "string", + "description": "The family name (last name) of this person." + }, + "formatted": { + "type": "string", + "description": "The full name of this person, including middle names, suffixes, etc." + }, + "givenName": { + "type": "string", + "description": "The given name (first name) of this person." + }, + "honorificPrefix": { + "type": "string", + "description": "The honorific prefixes (such as \"Dr.\" or \"Mrs.\") for this person." + }, + "honorificSuffix": { + "type": "string", + "description": "The honorific suffixes (such as \"Jr.\") for this person." + }, + "middleName": { + "type": "string", + "description": "The middle name of this person." + } + } + }, + "nickname": { + "type": "string", + "description": "The nickname of this person." + }, + "objectType": { + "type": "string", + "description": "Type of person within Google+. Possible values are: \n- \"person\" - represents an actual person. \n- \"page\" - represents a page." + }, + "organizations": { + "type": "array", + "description": "A list of current or past organizations with which this person is associated.", + "items": { + "type": "object", + "properties": { + "department": { + "type": "string", + "description": "The department within the organization. Deprecated." + }, + "description": { + "type": "string", + "description": "A short description of the person's role in this organization. Deprecated." + }, + "endDate": { + "type": "string", + "description": "The date the person left this organization." + }, + "location": { + "type": "string", + "description": "The location of this organization. Deprecated." + }, + "name": { + "type": "string", + "description": "The name of the organization." + }, + "primary": { + "type": "boolean", + "description": "If \"true\", indicates this organization is the person's primary one (typically interpreted as current one)." + }, + "startDate": { + "type": "string", + "description": "The date the person joined this organization." + }, + "title": { + "type": "string", + "description": "The person's job title or role within the organization." + }, + "type": { + "type": "string", + "description": "The type of organization. Possible values are: \n- \"work\" - Work. \n- \"school\" - School." + } + } + } + }, + "placesLived": { + "type": "array", + "description": "A list of places where this person has lived.", + "items": { + "type": "object", + "properties": { + "primary": { + "type": "boolean", + "description": "If \"true\", this place of residence is this person's primary residence." + }, + "value": { + "type": "string", + "description": "A place where this person has lived. For example: \"Seattle, WA\", \"Near Toronto\"." + } + } + } + }, + "relationshipStatus": { + "type": "string", + "description": "The person's relationship status. Possible values are: \n- \"single\" - Person is single. \n- \"in_a_relationship\" - Person is in a relationship. \n- \"engaged\" - Person is engaged. \n- \"married\" - Person is married. \n- \"its_complicated\" - The relationship is complicated. \n- \"open_relationship\" - Person is in an open relationship. \n- \"widowed\" - Person is widowed. \n- \"in_domestic_partnership\" - Person is in a domestic partnership. \n- \"in_civil_union\" - Person is in a civil union." + }, + "tagline": { + "type": "string", + "description": "The brief description (tagline) of this person." + }, + "url": { + "type": "string", + "description": "The URL of this person's profile." + }, + "urls": { + "type": "array", + "description": "A list of URLs for this person.", + "items": { + "type": "object", + "properties": { + "primary": { + "type": "boolean", + "description": "If \"true\", this URL is the person's primary URL." + }, + "type": { + "type": "string", + "description": "The type of URL. Possible values are: \n- \"home\" - URL for home. \n- \"work\" - URL for work. \n- \"blog\" - URL for blog. \n- \"profile\" - URL for profile. \n- \"other\" - Other." + }, + "value": { + "type": "string", + "description": "The URL value." + } + } + } + } + } + }, + "PlusAclentryResource": { + "id": "PlusAclentryResource", + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "A descriptive name for this entry. Suitable for display." + }, + "id": { + "type": "string", + "description": "The ID of the entry. For entries of type \"person\" or \"circle\", this is the ID of the resource. For other types, this property is not set." + }, + "type": { + "type": "string", + "description": "The type of entry describing to whom access is granted. Possible values are: \n- \"person\" - Access to an individual. \n- \"circle\" - Access to members of a circle. \n- \"myCircles\" - Access to members of all the person's circles. \n- \"extendedCircles\" - Access to members of everyone in a person's circles, plus all of the people in their circles. \n- \"public\" - Access to anyone on the web." + } + } + } + }, + "resources": { + "activities": { + "methods": { + "get": { + "id": "plus.activities.get", + "path": "activities/{activityId}", + "httpMethod": "GET", + "description": "Get an activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "activityId" + ], + "response": { + "$ref": "Activity" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.me" + ] + }, + "list": { + "id": "plus.activities.list", + "path": "people/{userId}/activities/{collection}", + "httpMethod": "GET", + "description": "List all of the activities in the specified collection for a particular user.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection of activities to list.", + "required": true, + "enum": [ + "public" + ], + "enumDescriptions": [ + "All public activities created by the specified user." + ], + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user to get activities for. The special value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "collection" + ], + "response": { + "$ref": "ActivityFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.me" + ] + }, + "search": { + "id": "plus.activities.search", + "path": "activities", + "httpMethod": "GET", + "description": "Search public activities.", + "parameters": { + "language": { + "type": "string", + "description": "Specify the preferred language to search with. See search language codes for available values.", + "default": "en-US", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "10", + "format": "uint32", + "minimum": "1", + "maximum": "20", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Specifies how to order search results.", + "default": "recent", + "enum": [ + "best", + "recent" + ], + "enumDescriptions": [ + "Sort activities by relevance to the user, most relevant first.", + "Sort activities by published date, most recent first." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response. This token can be of any length.", + "location": "query" + }, + "query": { + "type": "string", + "description": "Full-text search query string.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "query" + ], + "response": { + "$ref": "ActivityFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.me" + ] + } + } + }, + "comments": { + "methods": { + "get": { + "id": "plus.comments.get", + "path": "comments/{commentId}", + "httpMethod": "GET", + "description": "Get a comment.", + "parameters": { + "commentId": { + "type": "string", + "description": "The ID of the comment to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.me" + ] + }, + "list": { + "id": "plus.comments.list", + "path": "activities/{activityId}/comments", + "httpMethod": "GET", + "description": "List all of the comments for an activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to get comments for.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of comments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "The order in which to sort the list of comments.", + "default": "ascending", + "enum": [ + "ascending", + "descending" + ], + "enumDescriptions": [ + "Sort oldest comments first.", + "Sort newest comments first." + ], + "location": "query" + } + }, + "parameterOrder": [ + "activityId" + ], + "response": { + "$ref": "CommentFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.me" + ] + } + } + }, + "people": { + "methods": { + "get": { + "id": "plus.people.get", + "path": "people/{userId}", + "httpMethod": "GET", + "description": "Get a person's profile.", + "parameters": { + "userId": { + "type": "string", + "description": "The ID of the person to get the profile for. The special value \"me\" can be used to indicate the authenticated user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "Person" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.me" + ] + }, + "listByActivity": { + "id": "plus.people.listByActivity", + "path": "activities/{activityId}/people/{collection}", + "httpMethod": "GET", + "description": "List all of the people in the specified collection for a particular activity.", + "parameters": { + "activityId": { + "type": "string", + "description": "The ID of the activity to get the list of people for.", + "required": true, + "location": "path" + }, + "collection": { + "type": "string", + "description": "The collection of people to list.", + "required": true, + "enum": [ + "plusoners", + "resharers" + ], + "enumDescriptions": [ + "List all people who have +1'd this activity.", + "List all people who have reshared this activity." + ], + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "activityId", + "collection" + ], + "response": { + "$ref": "PeopleFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.me" + ] + }, + "search": { + "id": "plus.people.search", + "path": "people", + "httpMethod": "GET", + "description": "Search all public profiles.", + "parameters": { + "language": { + "type": "string", + "description": "Specify the preferred language to search with. See search language codes for available values.", + "default": "en-US", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.", + "default": "10", + "format": "uint32", + "minimum": "1", + "maximum": "20", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response. This token can be of any length.", + "location": "query" + }, + "query": { + "type": "string", + "description": "Specify a query string for full text search of public text in all profiles.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "query" + ], + "response": { + "$ref": "PeopleFeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/plus.me" + ] + } + } + } + } +} \ No newline at end of file diff --git a/project.clj b/project.clj new file mode 100644 index 0000000..906cead --- /dev/null +++ b/project.clj @@ -0,0 +1,3 @@ +(defproject gapi "1.0.0-SNAPSHOT" + :description "A simple pure clojure interface for Google web services" + :dependencies [[org.clojure/clojure "1.3.0"]]) \ No newline at end of file diff --git a/src/gapi/core.clj b/src/gapi/core.clj new file mode 100644 index 0000000..dab6639 --- /dev/null +++ b/src/gapi/core.clj @@ -0,0 +1,41 @@ +(ns gapi.core + (:require + [clojure.data.json :as json] + [clj-http.client :as http] + [clojure.string :as string])) + ) + +;; The base Discovery service URL we will process +(def base_url "https://www.googleapis.com/discovery/v1/apis") + +;; List the available APIs that can be built +(defn list-apis [] + (let [discovery-doc (json/read-json ((http/get "https://www.googleapis.com/discovery/v1/apis") :body))] + (map #(vector (str (%1 :name) "-" (%1 :version)) (%1 :discoveryRestUrl)) (discovery-doc :items)))) + +;; Macro to handle the authorisation tupple +(defn with-auth [auth]) + +;; Generate a client for the given API based on its discovery +;; document. +(defn build [api_url] + (let [ plus-doc (json/read-json ((http/get api_url) :body)) + base-url (plus-doc :baseUrl) + api-methods (reduce + (fn [resources [key resource]] + (reduce + (fn [methods [ikey method]] + (assoc ilist (method :id) + (create-method base-url method))) + methods + (resource :methods))) + {} + (plus-doc :resources)) + ] + api-methods + ) + + +;; Generate a client from a local file. +(defn build-local [file]) + diff --git a/src/gapi/oauth.clj b/src/gapi/oauth.clj new file mode 100644 index 0000000..32c6830 --- /dev/null +++ b/src/gapi/oauth.clj @@ -0,0 +1,30 @@ +(ns gapi.oauth) + +(def auth_url_base "") +(def token_url_base "") + +;; Return a state map used to manage the authentication session. +(defmethod set-auth-params) + +(defn set-auth-params [api_key] + (atom {apikey api_key})) + +(defn set-auth-params [client_id, client_secret, redirect_url] + (atom {clientid client_id, clientsecret client_secret, redirecturl redirect_url})) + +;; Return a state for an oauth object +(defn generate-auth-url [state] + ;; Pull out, and store state in state tuple + ) + +;; Retrieve a token for for the connection, and put +;; into the state object. Returns true on success +;; false on failure +(defn exchange_token [state, code, checkstate] + + ) + +;; Refresh an almost expired token +(defn refresh_token [state] + + ) \ No newline at end of file diff --git a/test/gapi/test/core.clj b/test/gapi/test/core.clj new file mode 100644 index 0000000..d0ef71f --- /dev/null +++ b/test/gapi/test/core.clj @@ -0,0 +1,6 @@ +(ns gapi.test.core + (:use [gapi.core]) + (:use [clojure.test])) + +(deftest replace-me ;; FIXME: write + (is false "No tests have been written."))