mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
feat(downloads): alt 'media' handling to allow dls
This also includes documentation to state which methods actually support media download, and how to achieve that. Added TODO to not forget we should tell the user how to achieve these kinds of things. Fixes #21
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/LJI9qShCZjBHg072lrR-8ZdwqHs\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/aZqXglKYhHRY6tGe90wBk2vmheM\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "adexchangeseller:v1.1",
|
"id": "adexchangeseller:v1.1",
|
||||||
"name": "adexchangeseller",
|
"name": "adexchangeseller",
|
||||||
"canonicalName": "Ad Exchange Seller",
|
"canonicalName": "Ad Exchange Seller",
|
||||||
"version": "v1.1",
|
"version": "v1.1",
|
||||||
"revision": "20150225",
|
"revision": "20150313",
|
||||||
"title": "Ad Exchange Seller API",
|
"title": "Ad Exchange Seller API",
|
||||||
"description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports",
|
"description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Udv6xd2CTeF5gBc5RK-Xrdwi5BU\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/gjjXjsHj8UTCjwoWB0KNSdU5LXw\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "adexchangeseller:v1",
|
"id": "adexchangeseller:v1",
|
||||||
"name": "adexchangeseller",
|
"name": "adexchangeseller",
|
||||||
"canonicalName": "Ad Exchange Seller",
|
"canonicalName": "Ad Exchange Seller",
|
||||||
"version": "v1",
|
"version": "v1",
|
||||||
"revision": "20150225",
|
"revision": "20150313",
|
||||||
"title": "Ad Exchange Seller API",
|
"title": "Ad Exchange Seller API",
|
||||||
"description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports",
|
"description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/-2ppmthl020S47FH8VO33hbOboc\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/eWJUNKoCWvcmB-gqHTIWg1zs684\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "adexchangeseller:v2.0",
|
"id": "adexchangeseller:v2.0",
|
||||||
"name": "adexchangeseller",
|
"name": "adexchangeseller",
|
||||||
"canonicalName": "Ad Exchange Seller",
|
"canonicalName": "Ad Exchange Seller",
|
||||||
"version": "v2.0",
|
"version": "v2.0",
|
||||||
"revision": "20150225",
|
"revision": "20150313",
|
||||||
"title": "Ad Exchange Seller API",
|
"title": "Ad Exchange Seller API",
|
||||||
"description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports",
|
"description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/qR09Xr4WyuppZd0FxNauFU4HZEY\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/_i2OsA9ICnxLuGp5SQSlE-RCl-A\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "adsense:v1.2",
|
"id": "adsense:v1.2",
|
||||||
"name": "adsense",
|
"name": "adsense",
|
||||||
"canonicalName": "AdSense",
|
"canonicalName": "AdSense",
|
||||||
"version": "v1.2",
|
"version": "v1.2",
|
||||||
"revision": "20150126",
|
"revision": "20150312",
|
||||||
"title": "AdSense Management API",
|
"title": "AdSense Management API",
|
||||||
"description": "Gives AdSense publishers access to their inventory and the ability to generate reports",
|
"description": "Gives AdSense publishers access to their inventory and the ability to generate reports",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/QLzYLvfST0FjKuQb6H8Y9VPJgoE\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Y1tUkFc0QQNBtKHfd75UEcFQizo\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "adsense:v1.3",
|
"id": "adsense:v1.3",
|
||||||
"name": "adsense",
|
"name": "adsense",
|
||||||
"canonicalName": "AdSense",
|
"canonicalName": "AdSense",
|
||||||
"version": "v1.3",
|
"version": "v1.3",
|
||||||
"revision": "20150126",
|
"revision": "20150312",
|
||||||
"title": "AdSense Management API",
|
"title": "AdSense Management API",
|
||||||
"description": "Gives AdSense publishers access to their inventory and the ability to generate reports",
|
"description": "Gives AdSense publishers access to their inventory and the ability to generate reports",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/GwVBOvnObENRnA8st3Br2OCaQxE\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/WPPN58Hu3NNElRYylPbHwGhmbWg\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "adsense:v1.4",
|
"id": "adsense:v1.4",
|
||||||
"name": "adsense",
|
"name": "adsense",
|
||||||
"canonicalName": "AdSense",
|
"canonicalName": "AdSense",
|
||||||
"version": "v1.4",
|
"version": "v1.4",
|
||||||
"revision": "20150126",
|
"revision": "20150312",
|
||||||
"title": "AdSense Management API",
|
"title": "AdSense Management API",
|
||||||
"description": "Gives AdSense publishers access to their inventory and the ability to generate reports",
|
"description": "Gives AdSense publishers access to their inventory and the ability to generate reports",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Ot75-sAq1Vj9vLc-q6gHNxVJqjQ\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/VI6vr1MPx9avVWB1RXoHKqps2IQ\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "adsensehost:v4.1",
|
"id": "adsensehost:v4.1",
|
||||||
"name": "adsensehost",
|
"name": "adsensehost",
|
||||||
"canonicalName": "AdSense Host",
|
"canonicalName": "AdSense Host",
|
||||||
"version": "v4.1",
|
"version": "v4.1",
|
||||||
"revision": "20150118",
|
"revision": "20150302",
|
||||||
"title": "AdSense Host API",
|
"title": "AdSense Host API",
|
||||||
"description": "Gives AdSense Hosts access to report generation, ad code generation, and publisher management capabilities.",
|
"description": "Gives AdSense Hosts access to report generation, ad code generation, and publisher management capabilities.",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/RcOjYGQDsg144Y5EM1meYl_XNYw\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/IldvChjq6UkiEW0nig_gOjP89aY\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "analytics:v2.4",
|
"id": "analytics:v2.4",
|
||||||
"name": "analytics",
|
"name": "analytics",
|
||||||
"version": "v2.4",
|
"version": "v2.4",
|
||||||
"revision": "20141118",
|
"revision": "20150308",
|
||||||
"title": "Google Analytics API",
|
"title": "Google Analytics API",
|
||||||
"description": "View and manage your Google Analytics data",
|
"description": "View and manage your Google Analytics data",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/aw3TpXPEnqSVSodmCVhPn55WgQk\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/6NlFUYEBMf81bxiwpXwPhu5e1RQ\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "analytics:v3",
|
"id": "analytics:v3",
|
||||||
"name": "analytics",
|
"name": "analytics",
|
||||||
"version": "v3",
|
"version": "v3",
|
||||||
"revision": "20141118",
|
"revision": "20150308",
|
||||||
"title": "Google Analytics API",
|
"title": "Google Analytics API",
|
||||||
"description": "View and manage your Google Analytics data",
|
"description": "View and manage your Google Analytics data",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/MCWK2CQLEDojVXJw1b4YdNiAmeY\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/QxG7oirHrzfDxJoQseQwOqPzaG0\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "bigquery:v2",
|
"id": "bigquery:v2",
|
||||||
"name": "bigquery",
|
"name": "bigquery",
|
||||||
"version": "v2",
|
"version": "v2",
|
||||||
"revision": "20150309",
|
"revision": "20141112",
|
||||||
"title": "BigQuery API",
|
"title": "BigQuery API",
|
||||||
"description": "A data platform for customers to create, manage, share and query data.",
|
"description": "A data platform for customers to create, manage, share and query data.",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
@@ -1071,6 +1071,10 @@
|
|||||||
"id": "TableDataInsertAllRequest",
|
"id": "TableDataInsertAllRequest",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"ignoreUnknownValues": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "[Optional] Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false, which treats unknown values as errors."
|
||||||
|
},
|
||||||
"kind": {
|
"kind": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The resource type of the response.",
|
"description": "The resource type of the response.",
|
||||||
@@ -1092,6 +1096,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"skipInvalidRows": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "[Optional] Insert all valid rows of a request, even if invalid rows exist. The default value is false, which causes the entire request to fail if any invalid rows exist."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/kNB4QIeM_hYb1gDtvlVUUPro4uQ\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/7vCHfrhi9Lj_cY5xxg_5Db6xPtw\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "books:v1",
|
"id": "books:v1",
|
||||||
"name": "books",
|
"name": "books",
|
||||||
"version": "v1",
|
"version": "v1",
|
||||||
"revision": "20150115",
|
"revision": "20150309",
|
||||||
"title": "Books API",
|
"title": "Books API",
|
||||||
"description": "Lets you search for books and manage your Google Books library.",
|
"description": "Lets you search for books and manage your Google Books library.",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
@@ -2817,34 +2817,6 @@
|
|||||||
"https://www.googleapis.com/auth/books"
|
"https://www.googleapis.com/auth/books"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"get": {
|
|
||||||
"id": "books.mylibrary.annotations.get",
|
|
||||||
"path": "mylibrary/annotations/{annotationId}",
|
|
||||||
"httpMethod": "GET",
|
|
||||||
"description": "Gets an annotation by its ID.",
|
|
||||||
"parameters": {
|
|
||||||
"annotationId": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The ID for the annotation to retrieve.",
|
|
||||||
"required": true,
|
|
||||||
"location": "path"
|
|
||||||
},
|
|
||||||
"source": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "String to identify the originator of this request.",
|
|
||||||
"location": "query"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"parameterOrder": [
|
|
||||||
"annotationId"
|
|
||||||
],
|
|
||||||
"response": {
|
|
||||||
"$ref": "Annotation"
|
|
||||||
},
|
|
||||||
"scopes": [
|
|
||||||
"https://www.googleapis.com/auth/books"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"insert": {
|
"insert": {
|
||||||
"id": "books.mylibrary.annotations.insert",
|
"id": "books.mylibrary.annotations.insert",
|
||||||
"path": "mylibrary/annotations",
|
"path": "mylibrary/annotations",
|
||||||
@@ -2907,12 +2879,6 @@
|
|||||||
"maximum": "40",
|
"maximum": "40",
|
||||||
"location": "query"
|
"location": "query"
|
||||||
},
|
},
|
||||||
"pageIds": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The page ID(s) for the volume that is being queried.",
|
|
||||||
"repeated": true,
|
|
||||||
"location": "query"
|
|
||||||
},
|
|
||||||
"pageToken": {
|
"pageToken": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The value of the nextToken from the previous page.",
|
"description": "The value of the nextToken from the previous page.",
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/43YyX2L2OP2AOVrWhgb-fE2Qsgk\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/chLcvyYPKZ3ZS_IQi224D9BXunY\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "calendar:v3",
|
"id": "calendar:v3",
|
||||||
"name": "calendar",
|
"name": "calendar",
|
||||||
"version": "v3",
|
"version": "v3",
|
||||||
"revision": "20150118",
|
"revision": "20141123",
|
||||||
"title": "Calendar API",
|
"title": "Calendar API",
|
||||||
"description": "Lets you manipulate events and other calendar data.",
|
"description": "Lets you manipulate events and other calendar data.",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/kwpiRqjQBcnxhE5-xYxQ0kF3ilA\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/O_5j_7aKimaeibrW3NmYraO3Ajs\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "compute:v1",
|
"id": "compute:v1",
|
||||||
"name": "compute",
|
"name": "compute",
|
||||||
"version": "v1",
|
"version": "v1",
|
||||||
"revision": "20150303",
|
"revision": "20150302",
|
||||||
"title": "Compute Engine API",
|
"title": "Compute Engine API",
|
||||||
"description": "API for the Google Compute Engine service.",
|
"description": "API for the Google Compute Engine service.",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
@@ -803,11 +803,11 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"destinationZone": {
|
"destinationZone": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The URL of the zone to which the disk will be moved."
|
"description": "The URL of the destination zone to move the disk to. This can be a full or partial URL. For example, the following are all valid URLs to a zone: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone \n- projects/project/zones/zone \n- zones/zone"
|
||||||
},
|
},
|
||||||
"targetDisk": {
|
"targetDisk": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The URL of the target disk to be moved."
|
"description": "The URL of the target disk to move. This can be a full or partial URL. For example, the following are all valid URLs to a disk: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk \n- projects/project/zones/zone/disks/disk \n- zones/zone/disks/disk"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1880,11 +1880,11 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"destinationZone": {
|
"destinationZone": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The URL of the zone to move the instance to."
|
"description": "The URL of the destination zone to move the instance to. This can be a full or partial URL. For example, the following are all valid URLs to a zone: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone \n- projects/project/zones/zone \n- zones/zone"
|
||||||
},
|
},
|
||||||
"targetInstance": {
|
"targetInstance": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The URL of the target instance to move."
|
"description": "The URL of the target instance to move. This can be a full or partial URL. For example, the following are all valid URLs to an instance: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance \n- projects/project/zones/zone/instances/instance \n- zones/zone/instances/instance"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2948,20 +2948,14 @@
|
|||||||
"enum": [
|
"enum": [
|
||||||
"BACKEND_SERVICES",
|
"BACKEND_SERVICES",
|
||||||
"CPUS",
|
"CPUS",
|
||||||
"DISKS",
|
|
||||||
"DISKS_TOTAL_GB",
|
"DISKS_TOTAL_GB",
|
||||||
"EPHEMERAL_ADDRESSES",
|
|
||||||
"FIREWALLS",
|
"FIREWALLS",
|
||||||
"FORWARDING_RULES",
|
"FORWARDING_RULES",
|
||||||
"HEALTH_CHECKS",
|
"HEALTH_CHECKS",
|
||||||
"IMAGES",
|
"IMAGES",
|
||||||
"IMAGES_TOTAL_GB",
|
|
||||||
"IN_USE_ADDRESSES",
|
"IN_USE_ADDRESSES",
|
||||||
"KERNELS",
|
|
||||||
"KERNELS_TOTAL_GB",
|
|
||||||
"LOCAL_SSD_TOTAL_GB",
|
"LOCAL_SSD_TOTAL_GB",
|
||||||
"NETWORKS",
|
"NETWORKS",
|
||||||
"OPERATIONS",
|
|
||||||
"ROUTES",
|
"ROUTES",
|
||||||
"SNAPSHOTS",
|
"SNAPSHOTS",
|
||||||
"SSD_TOTAL_GB",
|
"SSD_TOTAL_GB",
|
||||||
@@ -2989,12 +2983,6 @@
|
|||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
""
|
""
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -5030,6 +5018,7 @@
|
|||||||
"id": "compute.disks.createSnapshot",
|
"id": "compute.disks.createSnapshot",
|
||||||
"path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
|
"path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
|
||||||
"httpMethod": "POST",
|
"httpMethod": "POST",
|
||||||
|
"description": "Creates a snapshot of this disk.",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"disk": {
|
"disk": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ruh8vDKnI53dg6K4wnCZiPZpScI\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/aHn3JVvIgem2cQ4taTnQ3LnIpWc\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "deploymentmanager:v2beta1",
|
"id": "deploymentmanager:v2beta1",
|
||||||
"name": "deploymentmanager",
|
"name": "deploymentmanager",
|
||||||
"version": "v2beta1",
|
"version": "v2beta1",
|
||||||
"revision": "20150210",
|
"revision": "20141215",
|
||||||
"title": "Google Cloud Deployment Manager API V2",
|
"title": "Google Cloud Deployment Manager API V2",
|
||||||
"description": "The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.",
|
"description": "The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/uftxkEqaj-t-6C93huW22geUJjs\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Avr5yLDEaSyBxOoYvm8FoDAE8-g\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "genomics:v1beta2",
|
"id": "genomics:v1beta2",
|
||||||
"name": "genomics",
|
"name": "genomics",
|
||||||
"version": "v1beta2",
|
"version": "v1beta2",
|
||||||
"revision": "20150307",
|
"revision": "20150303",
|
||||||
"title": "Genomics API",
|
"title": "Genomics API",
|
||||||
"description": "Provides access to Genomics data.",
|
"description": "Provides access to Genomics data.",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
@@ -552,7 +552,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"exportUri": {
|
"exportUri": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A Google Cloud Storage URI where the exported BAM file will be created. The currently authenticated user must have write access to the new file location. An error will be returned if the URI already contains data."
|
"description": "A Google Cloud Storage URI for the exported BAM file. The currently authenticated user must have write access to the new file. An error will be returned if the URI already contains data."
|
||||||
},
|
},
|
||||||
"projectNumber": {
|
"projectNumber": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -1484,7 +1484,7 @@
|
|||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "free text description of this reference set."
|
"description": "Free text description of this reference set."
|
||||||
},
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -1765,7 +1765,7 @@
|
|||||||
},
|
},
|
||||||
"pageSize": {
|
"pageSize": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "Specifies number of results to return in a single page. If unspecified, it will default to 128. The maximum value is 1024.",
|
"description": "Specifies number of results to return in a single page. If unspecified, it will default to 256. The maximum value is 1024.",
|
||||||
"format": "int32"
|
"format": "int32"
|
||||||
},
|
},
|
||||||
"pageToken": {
|
"pageToken": {
|
||||||
@@ -2856,12 +2856,11 @@
|
|||||||
"id": "genomics.datasets.list",
|
"id": "genomics.datasets.list",
|
||||||
"path": "datasets",
|
"path": "datasets",
|
||||||
"httpMethod": "GET",
|
"httpMethod": "GET",
|
||||||
"description": "Lists all datasets.",
|
"description": "Lists datasets within a project.",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"pageSize": {
|
"pageSize": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "The maximum number of results returned by this request.",
|
"description": "The maximum number of results returned by this request. If unspecified, defaults to 50.",
|
||||||
"default": "50",
|
|
||||||
"format": "int32",
|
"format": "int32",
|
||||||
"location": "query"
|
"location": "query"
|
||||||
},
|
},
|
||||||
@@ -3241,7 +3240,6 @@
|
|||||||
"pageSize": {
|
"pageSize": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "The maximum number of results to return in a single page. If unspecified, defaults to 1024. The maximum value is 2048.",
|
"description": "The maximum number of results to return in a single page. If unspecified, defaults to 1024. The maximum value is 2048.",
|
||||||
"default": "1024",
|
|
||||||
"format": "int32",
|
"format": "int32",
|
||||||
"location": "query"
|
"location": "query"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/u55VLYY4MP7i0aXvJvy-8Bykhic\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/5025FW69eRcOdd_mm4_PTDhGzHE\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "gmail:v1",
|
"id": "gmail:v1",
|
||||||
"name": "gmail",
|
"name": "gmail",
|
||||||
"version": "v1",
|
"version": "v1",
|
||||||
"revision": "20150303",
|
"revision": "20150313",
|
||||||
"title": "Gmail API",
|
"title": "Gmail API",
|
||||||
"description": "The Gmail REST API.",
|
"description": "The Gmail REST API.",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
@@ -1333,6 +1333,12 @@
|
|||||||
"httpMethod": "POST",
|
"httpMethod": "POST",
|
||||||
"description": "Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.",
|
"description": "Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
|
"deleted": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Mark the email as permanently deleted (not TRASH) and only visible in Google Apps Vault to a Vault administrator. Only used for Google Apps for Work accounts.",
|
||||||
|
"default": "false",
|
||||||
|
"location": "query"
|
||||||
|
},
|
||||||
"internalDateSource": {
|
"internalDateSource": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Source for Gmail's internal date of the message.",
|
"description": "Source for Gmail's internal date of the message.",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/uMvgRqCygYBIh2d3lXb4f8cUWOw\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/8sBrpk7dyPsmoiW1fArUb0ZoCGY\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "groupsmigration:v1",
|
"id": "groupsmigration:v1",
|
||||||
"name": "groupsmigration",
|
"name": "groupsmigration",
|
||||||
@@ -67,6 +67,15 @@
|
|||||||
"location": "query"
|
"location": "query"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"auth": {
|
||||||
|
"oauth2": {
|
||||||
|
"scopes": {
|
||||||
|
"https://www.googleapis.com/auth/apps.groups.migration": {
|
||||||
|
"description": "Manage messages in groups on your domain"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"schemas": {
|
"schemas": {
|
||||||
"Groups": {
|
"Groups": {
|
||||||
"id": "Groups",
|
"id": "Groups",
|
||||||
@@ -107,6 +116,9 @@
|
|||||||
"response": {
|
"response": {
|
||||||
"$ref": "Groups"
|
"$ref": "Groups"
|
||||||
},
|
},
|
||||||
|
"scopes": [
|
||||||
|
"https://www.googleapis.com/auth/apps.groups.migration"
|
||||||
|
],
|
||||||
"supportsMediaUpload": true,
|
"supportsMediaUpload": true,
|
||||||
"mediaUpload": {
|
"mediaUpload": {
|
||||||
"accept": [
|
"accept": [
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/q8dY4UIVNRcK1B68dybhQ1dBwWc\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ORNICSF2Z1YjV7yMXdU4V945lGo\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "plus:v1",
|
"id": "plus:v1",
|
||||||
"name": "plus",
|
"name": "plus",
|
||||||
"version": "v1",
|
"version": "v1",
|
||||||
"revision": "20150122",
|
"revision": "20150303",
|
||||||
"title": "Google+ API",
|
"title": "Google+ API",
|
||||||
"description": "The Google+ API enables developers to build on top of the Google+ platform.",
|
"description": "The Google+ API enables developers to build on top of the Google+ platform.",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/D2Y34Y6W4h84dfzmMIBIqWNmCLk\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/pzJb3bipFURG3pTFQAI_x_KdTEY\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "plusDomains:v1",
|
"id": "plusDomains:v1",
|
||||||
"name": "plusDomains",
|
"name": "plusDomains",
|
||||||
"version": "v1",
|
"version": "v1",
|
||||||
"revision": "20150122",
|
"revision": "20150303",
|
||||||
"title": "Google+ Domains API",
|
"title": "Google+ Domains API",
|
||||||
"description": "The Google+ API enables developers to build on top of the Google+ platform.",
|
"description": "The Google+ API enables developers to build on top of the Google+ platform.",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Zoj2QNc62Iq34KyKgNb23b-JnD8\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/lfXuvexGjLWvv2bGYOX_MVmrKM4\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "youtubeAnalytics:v1",
|
"id": "youtubeAnalytics:v1",
|
||||||
"name": "youtubeAnalytics",
|
"name": "youtubeAnalytics",
|
||||||
"canonicalName": "YouTube Analytics",
|
"canonicalName": "YouTube Analytics",
|
||||||
"version": "v1",
|
"version": "v1",
|
||||||
"revision": "20150227",
|
"revision": "20150304",
|
||||||
"title": "YouTube Analytics API",
|
"title": "YouTube Analytics API",
|
||||||
"description": "Retrieve your YouTube Analytics reports.",
|
"description": "Retrieve your YouTube Analytics reports.",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
@@ -638,6 +638,12 @@
|
|||||||
"httpMethod": "GET",
|
"httpMethod": "GET",
|
||||||
"description": "Retrieve your YouTube Analytics reports.",
|
"description": "Retrieve your YouTube Analytics reports.",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
|
"currency": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The currency to which financial metrics should be converted. The default is US Dollar (USD). If the result contains no financial metrics, this flag will be ignored. Responds with an error if the specified currency is not recognized.",
|
||||||
|
"pattern": "[A-Z]{3}",
|
||||||
|
"location": "query"
|
||||||
|
},
|
||||||
"dimensions": {
|
"dimensions": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender. See the Available Reports document for a list of the reports that you can retrieve and the dimensions used for those reports. Also see the Dimensions document for definitions of those dimensions.",
|
"description": "A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender. See the Available Reports document for a list of the reports that you can retrieve and the dimensions used for those reports. Also see the Dimensions document for definitions of those dimensions.",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"kind": "discovery#restDescription",
|
"kind": "discovery#restDescription",
|
||||||
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/OA1845UIyhDx4Pbq_uwDYxxJabA\"",
|
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ID2nf7n7eRyIPf4mFz5QF1inEVE\"",
|
||||||
"discoveryVersion": "v1",
|
"discoveryVersion": "v1",
|
||||||
"id": "youtubeAnalytics:v1beta1",
|
"id": "youtubeAnalytics:v1beta1",
|
||||||
"name": "youtubeAnalytics",
|
"name": "youtubeAnalytics",
|
||||||
"canonicalName": "YouTube Analytics",
|
"canonicalName": "YouTube Analytics",
|
||||||
"version": "v1beta1",
|
"version": "v1beta1",
|
||||||
"revision": "20150227",
|
"revision": "20150304",
|
||||||
"title": "YouTube Analytics API",
|
"title": "YouTube Analytics API",
|
||||||
"description": "Retrieve your YouTube Analytics reports.",
|
"description": "Retrieve your YouTube Analytics reports.",
|
||||||
"ownerDomain": "google.com",
|
"ownerDomain": "google.com",
|
||||||
@@ -641,6 +641,12 @@
|
|||||||
"httpMethod": "GET",
|
"httpMethod": "GET",
|
||||||
"description": "Retrieve your YouTube Analytics reports.",
|
"description": "Retrieve your YouTube Analytics reports.",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
|
"currency": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The currency to which financial metrics should be converted. The default is US Dollar (USD). If the result contains no financial metrics, this flag will be ignored. Responds with an error if the specified currency is not recognized.",
|
||||||
|
"pattern": "[A-Z]{3}",
|
||||||
|
"location": "query"
|
||||||
|
},
|
||||||
"dimensions": {
|
"dimensions": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender. See the Available Reports document for a list of the reports that you can retrieve and the dimensions used for those reports. Also see the Dimensions document for definitions of those dimensions.",
|
"description": "A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender. See the Available Reports document for a list of the reports that you can retrieve and the dimensions used for those reports. Also see the Dimensions document for definitions of those dimensions.",
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ To use this library, you would put the following lines into your `Cargo.toml` fi
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
youtube3 = "0.0.1"
|
google-youtube3 = "0.0.1"
|
||||||
```
|
```
|
||||||
|
|
||||||
## A complete example
|
## A complete example
|
||||||
@@ -85,7 +85,7 @@ youtube3 = "0.0.1"
|
|||||||
extern crate hyper;
|
extern crate hyper;
|
||||||
extern crate "yup-oauth2" as oauth2;
|
extern crate "yup-oauth2" as oauth2;
|
||||||
extern crate "rustc-serialize" as rustc_serialize;
|
extern crate "rustc-serialize" as rustc_serialize;
|
||||||
extern crate youtube3;
|
extern crate "google-youtube3" as youtube3;
|
||||||
use youtube3::cmn::Result;
|
use youtube3::cmn::Result;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
|
use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# DO NOT EDIT !
|
# DO NOT EDIT !
|
||||||
[package]
|
[package]
|
||||||
|
|
||||||
name = "youtube3"
|
name = "google-youtube3"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
authors = ["Sebastian Thiel <byronimo@gmail>"]
|
authors = ["Sebastian Thiel <byronimo@gmail>"]
|
||||||
description = "A complete library to interact with YouTube (protocol v3)"
|
description = "A complete library to interact with YouTube (protocol v3)"
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
// DO NOT EDIT
|
// DO NOT EDIT
|
||||||
use std::marker::MarkerTrait;
|
use std::marker::MarkerTrait;
|
||||||
use std::io::{self, Read, Seek, Cursor, Write, SeekFrom};
|
use std::io::{self, Read, Seek, Cursor, Write, SeekFrom};
|
||||||
use std::default::Default;
|
|
||||||
|
|
||||||
use mime::{Mime, TopLevel, SubLevel, Attr, Value};
|
use mime::{Mime, TopLevel, SubLevel, Attr, Value};
|
||||||
use oauth2;
|
use oauth2;
|
||||||
@@ -186,22 +185,28 @@ impl<'a> MultiPartReader<'a> {
|
|||||||
|
|
||||||
impl<'a> Read for MultiPartReader<'a> {
|
impl<'a> Read for MultiPartReader<'a> {
|
||||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||||
if self.last_part_boundary.is_some() {
|
match (self.raw_parts.len(),
|
||||||
let br = self.last_part_boundary.as_mut().unwrap().read(buf).unwrap_or(0);
|
self.current_part.is_none(),
|
||||||
if br < buf.len() {
|
self.last_part_boundary.is_none()) {
|
||||||
self.last_part_boundary = None;
|
(_, _, false) => {
|
||||||
|
let br = self.last_part_boundary.as_mut().unwrap().read(buf).unwrap_or(0);
|
||||||
|
if br < buf.len() {
|
||||||
|
self.last_part_boundary = None;
|
||||||
|
}
|
||||||
|
return Ok(br)
|
||||||
|
},
|
||||||
|
(0, true, true) => return Ok(0),
|
||||||
|
(n, true, _) if n > 0 => {
|
||||||
|
let (headers, reader) = self.raw_parts.remove(0);
|
||||||
|
let mut c = Cursor::new(Vec::<u8>::new());
|
||||||
|
write!(&mut c, "{}--{}{}{}{}", LINE_ENDING, BOUNDARY, LINE_ENDING,
|
||||||
|
headers, LINE_ENDING).unwrap();
|
||||||
|
c.seek(SeekFrom::Start(0)).unwrap();
|
||||||
|
self.current_part = Some((c, reader));
|
||||||
}
|
}
|
||||||
return Ok(br)
|
_ => {},
|
||||||
} else if self.is_depleted() {
|
|
||||||
return Ok(0)
|
|
||||||
} else if self.raw_parts.len() > 0 && self.current_part.is_none() {
|
|
||||||
let (headers, reader) = self.raw_parts.remove(0);
|
|
||||||
let mut c = Cursor::new(Vec::<u8>::new());
|
|
||||||
write!(&mut c, "{}--{}{}{}{}", LINE_ENDING, BOUNDARY, LINE_ENDING,
|
|
||||||
headers, LINE_ENDING).unwrap();
|
|
||||||
c.seek(SeekFrom::Start(0)).unwrap();
|
|
||||||
self.current_part = Some((c, reader));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// read headers as long as possible
|
// read headers as long as possible
|
||||||
let (hb, rr) = {
|
let (hb, rr) = {
|
||||||
let &mut (ref mut c, ref mut reader) = self.current_part.as_mut().unwrap();
|
let &mut (ref mut c, ref mut reader) = self.current_part.as_mut().unwrap();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -11,8 +11,8 @@
|
|||||||
doc_root = directories.output + '/doc'
|
doc_root = directories.output + '/doc'
|
||||||
doc_index = doc_root + '/index.html'
|
doc_index = doc_root + '/index.html'
|
||||||
|
|
||||||
to_doc_root = lambda gen_root, api_name: gen_root + '/target/doc/' + api_name
|
to_doc_root = lambda gen_root, crate_name: gen_root + '/target/doc/' + crate_name
|
||||||
central_api_index = lambda api_name: doc_root + '/' + api_name + '/index.html'
|
central_api_index = lambda crate_name: doc_root + '/' + crate_name + '/index.html'
|
||||||
|
|
||||||
discovery_url = 'https://www.googleapis.com/discovery/v1/'
|
discovery_url = 'https://www.googleapis.com/discovery/v1/'
|
||||||
apis = json.loads(urllib2.urlopen(discovery_url + "apis").read())
|
apis = json.loads(urllib2.urlopen(discovery_url + "apis").read())
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
import util
|
import util
|
||||||
import os
|
import os
|
||||||
api_name = util.library_name(an, version)
|
api_name = util.library_name(an, version)
|
||||||
|
crate_name = util.library_to_crate_name(api_name)
|
||||||
gen_root = directories.output + '/' + api_name
|
gen_root = directories.output + '/' + api_name
|
||||||
gen_root_stamp = gen_root + '/.timestamp'
|
gen_root_stamp = gen_root + '/.timestamp'
|
||||||
api_common = gen_root + '/src/cmn.rs'
|
api_common = gen_root + '/src/cmn.rs'
|
||||||
@@ -34,7 +35,7 @@
|
|||||||
api_cargo = api_name + '-cargo'
|
api_cargo = api_name + '-cargo'
|
||||||
api_doc = api_name + '-doc'
|
api_doc = api_name + '-doc'
|
||||||
|
|
||||||
api_doc_root = to_doc_root(gen_root, api_name)
|
api_doc_root = to_doc_root(gen_root, crate_name)
|
||||||
api_doc_index = api_doc_root + '/index.html'
|
api_doc_index = api_doc_root + '/index.html'
|
||||||
|
|
||||||
# source, destination of individual output files
|
# source, destination of individual output files
|
||||||
@@ -70,9 +71,9 @@ ${api_doc_index}: ${api_name}
|
|||||||
|
|
||||||
${api_doc}: ${api_doc_index}
|
${api_doc}: ${api_doc_index}
|
||||||
|
|
||||||
${central_api_index(api_name)}: ${api_doc_index}
|
${central_api_index(crate_name)}: ${api_doc_index}
|
||||||
@mkdir -p ${doc_root}
|
@mkdir -p ${doc_root}
|
||||||
cp -Rf ${os.path.dirname(to_doc_root(gen_root, api_name))}/* ${doc_root}
|
cp -Rf ${os.path.dirname(to_doc_root(gen_root, crate_name))}/* ${doc_root}
|
||||||
|
|
||||||
${api_clean}:
|
${api_clean}:
|
||||||
-rm -Rf ${gen_root}
|
-rm -Rf ${gen_root}
|
||||||
@@ -83,7 +84,7 @@ clean-apis: ${space_join(1)} docs-clean
|
|||||||
cargo: ${space_join(2)}
|
cargo: ${space_join(2)}
|
||||||
apis: ${space_join(0)}
|
apis: ${space_join(0)}
|
||||||
|
|
||||||
${doc_index}: ${' '.join(central_api_index(a[0]) for a in api_info)} $(MAKO_STANDARD_DEPENDENCIES)
|
${doc_index}: ${' '.join(central_api_index(util.library_to_crate_name(a[0])) for a in api_info)} $(MAKO_STANDARD_DEPENDENCIES)
|
||||||
$(MAKO) --var DOC_ROOT=${doc_root} -io $(MAKO_SRC)/index.html.mako=$@ --data-files $(API_SHARED_INFO) $(API_LIST)
|
$(MAKO) --var DOC_ROOT=${doc_root} -io $(MAKO_SRC)/index.html.mako=$@ --data-files $(API_SHARED_INFO) $(API_LIST)
|
||||||
@echo Documentation index created at '$@'
|
@echo Documentation index created at '$@'
|
||||||
|
|
||||||
|
|||||||
@@ -132,6 +132,10 @@ ${link('Hub Delegate', delegate_url)}, or the ${link('Authenticator Delegate', u
|
|||||||
When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
|
When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
|
||||||
makes the system potentially resilient to all kinds of errors.
|
makes the system potentially resilient to all kinds of errors.
|
||||||
|
|
||||||
|
${'##'} About Uploads and Downlods
|
||||||
|
|
||||||
|
TODO: 'alt' media for downloads, custom methods for uploads (simple, resumable)
|
||||||
|
|
||||||
${'##'} About Customization/Callbacks
|
${'##'} About Customization/Callbacks
|
||||||
|
|
||||||
You may alter the way an `${api.terms.action}()` method is called by providing a ${link('delegate', delegate_url)} to the
|
You may alter the way an `${api.terms.action}()` method is called by providing a ${link('delegate', delegate_url)} to the
|
||||||
|
|||||||
@@ -35,6 +35,8 @@
|
|||||||
fn_name = 'add_' + fn_name
|
fn_name = 'add_' + fn_name
|
||||||
return fn_name
|
return fn_name
|
||||||
|
|
||||||
|
add_param_fn = 'param'
|
||||||
|
|
||||||
%>\
|
%>\
|
||||||
<%namespace name="util" file="util.mako"/>\
|
<%namespace name="util" file="util.mako"/>\
|
||||||
<%namespace name="lib" file="lib.mako"/>\
|
<%namespace name="lib" file="lib.mako"/>\
|
||||||
@@ -46,6 +48,8 @@
|
|||||||
<%
|
<%
|
||||||
hub_type_name = hub_type(schemas,util.canonical_name())
|
hub_type_name = hub_type(schemas,util.canonical_name())
|
||||||
m = c.fqan_map[to_fqan(c.rtc_map[resource], resource, method)]
|
m = c.fqan_map[to_fqan(c.rtc_map[resource], resource, method)]
|
||||||
|
response_schema = method_response(c, m)
|
||||||
|
|
||||||
# an identifier for a property. We prefix them to prevent clashes with the setters
|
# an identifier for a property. We prefix them to prevent clashes with the setters
|
||||||
mb_tparams = mb_type_params_s(m)
|
mb_tparams = mb_type_params_s(m)
|
||||||
ThisType = mb_type(resource, method) + mb_tparams
|
ThisType = mb_type(resource, method) + mb_tparams
|
||||||
@@ -60,6 +64,15 @@
|
|||||||
${m.description | rust_doc_comment}
|
${m.description | rust_doc_comment}
|
||||||
///
|
///
|
||||||
% endif
|
% endif
|
||||||
|
% if m.get('supportsMediaDownload', False):
|
||||||
|
/// This method supports **media download**. To enable it, set the *alt* parameter to *media*, .i.e.
|
||||||
|
/// `.${add_param_fn}("alt", "media")`.
|
||||||
|
% if response_schema:
|
||||||
|
/// Please note that due to missing multi-part support on the server side, you will only receive the media,
|
||||||
|
/// but not the `${response_schema.id}` structure that you would usually get. The latter will be a default value.
|
||||||
|
% endif
|
||||||
|
///
|
||||||
|
% endif ## supports media download
|
||||||
/// A builder for the *${method}* method supported by a *${singular(resource)}* resource.
|
/// A builder for the *${method}* method supported by a *${singular(resource)}* resource.
|
||||||
/// It is not used directly, but through a `${rb_type(resource)}`.
|
/// It is not used directly, but through a `${rb_type(resource)}`.
|
||||||
///
|
///
|
||||||
@@ -135,7 +148,7 @@ ${self._setter_fn(resource, method, m, p, part_prop, ThisType, c)}\
|
|||||||
/// * *${opn}* (${op.location}-${op.type}) - ${op.description}
|
/// * *${opn}* (${op.location}-${op.type}) - ${op.description}
|
||||||
% endfor
|
% endfor
|
||||||
% endif
|
% endif
|
||||||
pub fn param<T>(mut self, name: T, value: T) -> ${ThisType}
|
pub fn ${add_param_fn}<T>(mut self, name: T, value: T) -> ${ThisType}
|
||||||
where T: Str {
|
where T: Str {
|
||||||
self.${api.properties.params}.insert(name.as_slice().to_string(), value.as_slice().to_string());
|
self.${api.properties.params}.insert(name.as_slice().to_string(), value.as_slice().to_string());
|
||||||
self
|
self
|
||||||
@@ -370,10 +383,12 @@ match result {
|
|||||||
rtype = 'cmn::Result<hyper::client::Response>'
|
rtype = 'cmn::Result<hyper::client::Response>'
|
||||||
response_schema = method_response(c, m)
|
response_schema = method_response(c, m)
|
||||||
|
|
||||||
|
supports_download = m.get('supportsMediaDownload', False);
|
||||||
reserved_params = []
|
reserved_params = []
|
||||||
if response_schema:
|
if response_schema:
|
||||||
|
if not supports_download:
|
||||||
|
reserved_params = ['alt']
|
||||||
rtype = 'cmn::Result<(hyper::client::Response, %s)>' % (response_schema.id)
|
rtype = 'cmn::Result<(hyper::client::Response, %s)>' % (response_schema.id)
|
||||||
reserved_params = ['alt']
|
|
||||||
|
|
||||||
mtype_param = 'RS'
|
mtype_param = 'RS'
|
||||||
mtype_where = 'ReadSeek'
|
mtype_where = 'ReadSeek'
|
||||||
@@ -462,12 +477,8 @@ match result {
|
|||||||
## "the trait `core::marker::Sized` is not implemented for the type `std::io::Read`"
|
## "the trait `core::marker::Sized` is not implemented for the type `std::io::Read`"
|
||||||
use hyper::client::IntoBody;
|
use hyper::client::IntoBody;
|
||||||
use std::io::{Read, Seek};
|
use std::io::{Read, Seek};
|
||||||
use hyper::header::{ContentType, ContentLength};
|
use hyper::header::{ContentType, ContentLength, Authorization, UserAgent};
|
||||||
let mut params = Vec::new();
|
let mut params: Vec<(&str, String)> = Vec::with_capacity((${len(params) + len(reserved_params)} + ${paddfields}.len()));
|
||||||
params.reserve_exact((${len(params) + len(reserved_params)} + ${paddfields}.len()));
|
|
||||||
% if response_schema:
|
|
||||||
params.push(("alt", "json".to_string()));
|
|
||||||
% endif
|
|
||||||
% for p in field_params:
|
% for p in field_params:
|
||||||
<%
|
<%
|
||||||
pname = 'self.' + property(p.name) # property identifier
|
pname = 'self.' + property(p.name) # property identifier
|
||||||
@@ -510,6 +521,30 @@ match result {
|
|||||||
params.push((&name, value.clone()));
|
params.push((&name, value.clone()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
% if response_schema:
|
||||||
|
% if supports_download:
|
||||||
|
let (json_field_missing, enable_resource_parsing) = {
|
||||||
|
let mut enable = true;
|
||||||
|
let mut field_present = true;
|
||||||
|
for &(name, ref value) in params.iter() {
|
||||||
|
if name == "alt" {
|
||||||
|
field_present = false;
|
||||||
|
if value.as_slice() != "json" {
|
||||||
|
enable = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(field_present, enable)
|
||||||
|
};
|
||||||
|
if json_field_missing {
|
||||||
|
params.push(("alt", "json".to_string()));
|
||||||
|
}
|
||||||
|
% else:
|
||||||
|
params.push(("alt", "json".to_string()));
|
||||||
|
% endif ## supportsMediaDownload
|
||||||
|
% endif ## response schema
|
||||||
|
|
||||||
% if media_params:
|
% if media_params:
|
||||||
let (mut url, protocol) = \
|
let (mut url, protocol) = \
|
||||||
% for mp in media_params:
|
% for mp in media_params:
|
||||||
@@ -613,7 +648,7 @@ else {
|
|||||||
if token.is_none() {
|
if token.is_none() {
|
||||||
return cmn::Result::MissingToken
|
return cmn::Result::MissingToken
|
||||||
}
|
}
|
||||||
let auth_header = hyper::header::Authorization(token.unwrap().access_token);
|
let auth_header = Authorization(token.unwrap().access_token);
|
||||||
% endif
|
% endif
|
||||||
% if request_value:
|
% if request_value:
|
||||||
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
|
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
|
||||||
@@ -634,7 +669,7 @@ else {
|
|||||||
% endif
|
% endif
|
||||||
|
|
||||||
let mut req = client.borrow_mut().request(hyper::method::Method::Extension("${m.httpMethod}".to_string()), url.as_slice())
|
let mut req = client.borrow_mut().request(hyper::method::Method::Extension("${m.httpMethod}".to_string()), url.as_slice())
|
||||||
.header(hyper::header::UserAgent(self.hub._user_agent.clone()))\
|
.header(UserAgent(self.hub._user_agent.clone()))\
|
||||||
% if supports_scopes(auth):
|
% if supports_scopes(auth):
|
||||||
|
|
||||||
.header(auth_header)\
|
.header(auth_header)\
|
||||||
@@ -690,9 +725,20 @@ else {
|
|||||||
return cmn::Result::Failure(res)
|
return cmn::Result::Failure(res)
|
||||||
}
|
}
|
||||||
% if response_schema:
|
% if response_schema:
|
||||||
let mut json_response = String::new();
|
## If 'alt' is not json, we cannot attempt to decode the response
|
||||||
res.read_to_string(&mut json_response).unwrap();
|
let result_value = \
|
||||||
let result_value = (res, json::decode(&json_response).unwrap());
|
% if supports_download:
|
||||||
|
if enable_resource_parsing \
|
||||||
|
% endif
|
||||||
|
{
|
||||||
|
let mut json_response = String::new();
|
||||||
|
res.read_to_string(&mut json_response).unwrap();
|
||||||
|
(res, json::decode(&json_response).unwrap())
|
||||||
|
}\
|
||||||
|
% if supports_download:
|
||||||
|
else { (res, Default::default()) }\
|
||||||
|
% endif
|
||||||
|
;
|
||||||
% else:
|
% else:
|
||||||
let result_value = res;
|
let result_value = res;
|
||||||
% endif
|
% endif
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ ${util.library_name(name, version)}\
|
|||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
<%def name="crate_name()" buffered="True">\
|
<%def name="crate_name()" buffered="True">\
|
||||||
google-${self.library_name()}\
|
${util.library_to_crate_name(util.library_name(name, version))}\
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
## All crates and standard `use` declaration, required for all examples
|
## All crates and standard `use` declaration, required for all examples
|
||||||
|
|||||||
@@ -748,6 +748,10 @@ def library_name(name, version):
|
|||||||
version = 'v' + version
|
version = 'v' + version
|
||||||
return normalize_library_name(name) + version
|
return normalize_library_name(name) + version
|
||||||
|
|
||||||
|
# return crate name for given result of `library_name()`
|
||||||
|
def library_to_crate_name(name):
|
||||||
|
return 'google-' + name
|
||||||
|
|
||||||
# return type name of a resource method builder, from a resource name
|
# return type name of a resource method builder, from a resource name
|
||||||
def rb_type(r):
|
def rb_type(r):
|
||||||
return "%sMethodsBuilder" % singular(canonical_type_name(r))
|
return "%sMethodsBuilder" % singular(canonical_type_name(r))
|
||||||
|
|||||||
Reference in New Issue
Block a user