From 62b63b251ac13fb945c444bd100b97fc7846a3c8 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 21 Jul 2015 18:36:44 +0200 Subject: [PATCH] chore(json-update): latest json files This also adds a usable version of the genomics API, which was empty previously (and if I recall correctly). --- .../v1.2/adexchangebuyer-api.json | 4 +- .../v1.3/adexchangebuyer-api.json | 4 +- .../v1.1/adexchangeseller-api.json | 4 +- .../v1/adexchangeseller-api.json | 4 +- .../v2.0/adexchangeseller-api.json | 4 +- etc/api/adsense/v1.2/adsense-api.json | 4 +- etc/api/adsense/v1.3/adsense-api.json | 4 +- etc/api/adsense/v1.4/adsense-api.json | 4 +- etc/api/adsensehost/v4.1/adsensehost-api.json | 4 +- .../v1/androidenterprise-api.json | 28 +- etc/api/api-list.yaml | 2 + etc/api/appstate/v1/appstate-api.json | 4 +- .../autoscaler/v1beta2/autoscaler-api.json | 4 +- etc/api/bigquery/v2/bigquery-api.json | 31 +- etc/api/calendar/v3/calendar-api.json | 66 +- etc/api/civicinfo/v2/civicinfo-api.json | 39 +- .../v2beta2/cloudmonitoring-api.json | 13 +- .../v1beta1/cloudresourcemanager-api.json | 26 +- .../alpha/clouduseraccounts-api.json | 19 +- .../vm_alpha/clouduseraccounts-api.json | 19 +- etc/api/compute/v1/compute-api.json | 2724 +++- .../alpha/computeaccounts-api.json | 98 +- etc/api/container/v1beta1/container-api.json | 4 +- etc/api/content/v2/content-api.json | 70 +- etc/api/dataflow/v1b3/dataflow-api.json | 45 +- .../v2beta1/deploymentmanager-api.json | 4 +- .../v2beta2/deploymentmanager-api.json | 34 +- etc/api/discovery/v1/discovery-api.json | 6 +- etc/api/dns/v1/dns-api.json | 9 +- etc/api/dns/v1beta1/dns-api.json | 9 +- .../v2/doubleclicksearch-api.json | 4 +- etc/api/drive/v1/drive-api.json | 7 +- etc/api/drive/v2/drive-api.json | 63 +- etc/api/fitness/v1/fitness-api.json | 114 +- etc/api/freebase/v1-sandbox/freebase-api.json | 4 +- etc/api/freebase/v1/freebase-api.json | 4 +- etc/api/freebase/v1sandbox/freebase-api.json | 4 +- etc/api/fusiontables/v1/fusiontables-api.json | 4 +- etc/api/fusiontables/v2/fusiontables-api.json | 4 +- etc/api/games/v1/games-api.json | 6 +- .../gamesconfiguration-api.json | 4 +- .../v1management/gamesmanagement-api.json | 6 +- etc/api/genomics/v1/genomics-api.json | 2546 ++- etc/api/genomics/v1beta2/genomics-api.json | 18 +- .../v3/identitytoolkit-api.json | 4 +- etc/api/mapsengine/exp2/mapsengine-api.json | 4 +- etc/api/mapsengine/v1/mapsengine-api.json | 4 +- etc/api/oauth2/v1/oauth2-api.json | 58 +- etc/api/oauth2/v2/oauth2-api.json | 4 +- etc/api/plus/v1/plus-api.json | 4 +- etc/api/plusdomains/v1/plusdomains-api.json | 4 +- etc/api/pubsub/v1beta1a/pubsub-api.json | 4 +- etc/api/pubsub/v1beta2/pubsub-api.json | 42 +- .../replicapool/v1beta1/replicapool-api.json | 4 +- .../replicapool/v1beta2/replicapool-api.json | 16 +- .../v1beta1/resourceviews-api.json | 4 +- .../v1beta2/resourceviews-api.json | 4 +- etc/api/sqladmin/v1beta3/sqladmin-api.json | 4 +- etc/api/sqladmin/v1beta4/sqladmin-api.json | 4 +- etc/api/storage/v1/storage-api.json | 9 +- etc/api/storage/v1beta1/storage-api.json | 4 +- etc/api/storage/v1beta2/storage-api.json | 4 +- etc/api/webmasters/v3/webmasters-api.json | 228 +- etc/api/youtube/v3/youtube-api.json | 66 +- .../v1/youtubeanalytics-api.json | 4 +- .../v1beta1/youtubeanalytics-api.json | 4 +- gen/genomics1-cli/Cargo.toml | 8 +- gen/genomics1-cli/README.md | 60 +- gen/genomics1-cli/mkdocs.yml | 43 +- gen/genomics1-cli/src/main.rs | 4232 ++++- gen/genomics1/Cargo.toml | 6 +- gen/genomics1/README.md | 62 +- gen/genomics1/src/cmn.rs | 14 +- gen/genomics1/src/lib.rs | 62 +- gen/genomics1/src/lib.rs.in | 12857 +++++++++++++++- 75 files changed, 23363 insertions(+), 542 deletions(-) diff --git a/etc/api/adexchangebuyer/v1.2/adexchangebuyer-api.json b/etc/api/adexchangebuyer/v1.2/adexchangebuyer-api.json index d244417311..d217abcaee 100644 --- a/etc/api/adexchangebuyer/v1.2/adexchangebuyer-api.json +++ b/etc/api/adexchangebuyer/v1.2/adexchangebuyer-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/B9as-vwOS9AM116cSm-3C_gic94\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/DwJSYFvXcf8mrS1WsFZlxGOERvU\"", "discoveryVersion": "v1", "id": "adexchangebuyer:v1.2", "name": "adexchangebuyer", "canonicalName": "Ad Exchange Buyer", "version": "v1.2", - "revision": "20150520", + "revision": "20150720", "title": "Ad Exchange Buyer API", "description": "Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.", "ownerDomain": "google.com", diff --git a/etc/api/adexchangebuyer/v1.3/adexchangebuyer-api.json b/etc/api/adexchangebuyer/v1.3/adexchangebuyer-api.json index e4c8ea2e25..2993324446 100644 --- a/etc/api/adexchangebuyer/v1.3/adexchangebuyer-api.json +++ b/etc/api/adexchangebuyer/v1.3/adexchangebuyer-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ekf6O2lwsP92coEGgGA2ge5cRGA\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/8nsIrKsc1vAa3qubc_DXk_Tozg4\"", "discoveryVersion": "v1", "id": "adexchangebuyer:v1.3", "name": "adexchangebuyer", "canonicalName": "Ad Exchange Buyer", "version": "v1.3", - "revision": "20150520", + "revision": "20150720", "title": "Ad Exchange Buyer API", "description": "Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.", "ownerDomain": "google.com", diff --git a/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json b/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json index 0a772dc71a..993dce82c8 100644 --- a/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json +++ b/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/GvYt66UFqsD2lyh6__RT4TIfEpw\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/j44TbuFHXezqR2Q6tkPbs1L5Eco\"", "discoveryVersion": "v1", "id": "adexchangeseller:v1.1", "name": "adexchangeseller", "canonicalName": "Ad Exchange Seller", "version": "v1.1", - "revision": "20150617", + "revision": "20150719", "title": "Ad Exchange Seller API", "description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports", "ownerDomain": "google.com", diff --git a/etc/api/adexchangeseller/v1/adexchangeseller-api.json b/etc/api/adexchangeseller/v1/adexchangeseller-api.json index 52aaca1fcd..448ca9b45d 100644 --- a/etc/api/adexchangeseller/v1/adexchangeseller-api.json +++ b/etc/api/adexchangeseller/v1/adexchangeseller-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/lIr0o2X-yT10aIbPZZWXwQ6eaxg\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/tNOKph3rsvOHJA5sN7Quej1AZOs\"", "discoveryVersion": "v1", "id": "adexchangeseller:v1", "name": "adexchangeseller", "canonicalName": "Ad Exchange Seller", "version": "v1", - "revision": "20150617", + "revision": "20150719", "title": "Ad Exchange Seller API", "description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports", "ownerDomain": "google.com", diff --git a/etc/api/adexchangeseller/v2.0/adexchangeseller-api.json b/etc/api/adexchangeseller/v2.0/adexchangeseller-api.json index 8e9200a902..4a0925b4d6 100644 --- a/etc/api/adexchangeseller/v2.0/adexchangeseller-api.json +++ b/etc/api/adexchangeseller/v2.0/adexchangeseller-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/c8b314M2iOuvSH6U9ZroqWZwQl4\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ZlVzmc6cGzlUBkUKLlEpFpCcsvs\"", "discoveryVersion": "v1", "id": "adexchangeseller:v2.0", "name": "adexchangeseller", "canonicalName": "Ad Exchange Seller", "version": "v2.0", - "revision": "20150617", + "revision": "20150719", "title": "Ad Exchange Seller API", "description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports", "ownerDomain": "google.com", diff --git a/etc/api/adsense/v1.2/adsense-api.json b/etc/api/adsense/v1.2/adsense-api.json index a85ec07563..92c8526577 100644 --- a/etc/api/adsense/v1.2/adsense-api.json +++ b/etc/api/adsense/v1.2/adsense-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/z7MA4Sf83xk94dcPThuFIYyVJEo\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/I5NJTJavAUWTApulQHkuCzC09uQ\"", "discoveryVersion": "v1", "id": "adsense:v1.2", "name": "adsense", "canonicalName": "AdSense", "version": "v1.2", - "revision": "20150617", + "revision": "20150719", "title": "AdSense Management API", "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", "ownerDomain": "google.com", diff --git a/etc/api/adsense/v1.3/adsense-api.json b/etc/api/adsense/v1.3/adsense-api.json index 0c59d5d1cb..58eda02ad5 100644 --- a/etc/api/adsense/v1.3/adsense-api.json +++ b/etc/api/adsense/v1.3/adsense-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/zXyQdMUcVqU3jX8pCYi1fmxl-ZE\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/kmJk90xUw7VsbFA_gzMzs-ICIGg\"", "discoveryVersion": "v1", "id": "adsense:v1.3", "name": "adsense", "canonicalName": "AdSense", "version": "v1.3", - "revision": "20150617", + "revision": "20150719", "title": "AdSense Management API", "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", "ownerDomain": "google.com", diff --git a/etc/api/adsense/v1.4/adsense-api.json b/etc/api/adsense/v1.4/adsense-api.json index 60d7ba0344..059c811a67 100644 --- a/etc/api/adsense/v1.4/adsense-api.json +++ b/etc/api/adsense/v1.4/adsense-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/UqvhrXgnTT9NcqAeBIivKsxHP9E\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/nuOwGkuqFyUiUFauZW3AcmqSRLc\"", "discoveryVersion": "v1", "id": "adsense:v1.4", "name": "adsense", "canonicalName": "AdSense", "version": "v1.4", - "revision": "20150617", + "revision": "20150719", "title": "AdSense Management API", "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", "ownerDomain": "google.com", diff --git a/etc/api/adsensehost/v4.1/adsensehost-api.json b/etc/api/adsensehost/v4.1/adsensehost-api.json index 12e931b7dd..8b71e49827 100644 --- a/etc/api/adsensehost/v4.1/adsensehost-api.json +++ b/etc/api/adsensehost/v4.1/adsensehost-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/PXi2YxruQPyOx7csXScLsx5SoZs\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/P4LsqeR0vNB-maCbAU7pmq8Pi1Y\"", "discoveryVersion": "v1", "id": "adsensehost:v4.1", "name": "adsensehost", "canonicalName": "AdSense Host", "version": "v4.1", - "revision": "20150617", + "revision": "20150719", "title": "AdSense Host API", "description": "Gives AdSense Hosts access to report generation, ad code generation, and publisher management capabilities.", "ownerDomain": "google.com", diff --git a/etc/api/androidenterprise/v1/androidenterprise-api.json b/etc/api/androidenterprise/v1/androidenterprise-api.json index a8557f9daa..95508ad427 100644 --- a/etc/api/androidenterprise/v1/androidenterprise-api.json +++ b/etc/api/androidenterprise/v1/androidenterprise-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/TAGoQX581k0pUlJRReLGRYb2z5U\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/T8xjS8-LAPJJ1wXBIGC7t3Ehz9c\"", "discoveryVersion": "v1", "id": "androidenterprise:v1", "name": "androidenterprise", "canonicalName": "Android Enterprise", "version": "v1", - "revision": "20150303", + "revision": "20150715", "title": "Google Play EMM API", "description": "Allows MDMs/EMMs and enterprises to manage the deployment of apps to Android for Work users.", "ownerDomain": "google.com", @@ -15,6 +15,7 @@ "x16": "https://www.google.com/images/icons/product/android-16.png", "x32": "https://www.google.com/images/icons/product/android-32.png" }, + "documentationLink": "https://developers.google.com/play/enterprise", "protocol": "rest", "baseUrl": "https://www.googleapis.com/androidenterprise/v1/", "basePath": "/androidenterprise/v1/", @@ -165,16 +166,16 @@ "AppVersion": { "id": "AppVersion", "type": "object", - "description": "App version represents a single APK version.", + "description": "This represents a single version of the app.", "properties": { "versionCode": { "type": "integer", - "description": "Unique increasing identifier for the apk version.", + "description": "Unique increasing identifier for the app version.", "format": "int32" }, "versionString": { "type": "string", - "description": "The string used in the Play Store by the app developer to identify a version of an app. The string is not necessarily unique or localized (e.g. \"1.4\")." + "description": "The string used in the Play Store by the app developer to identify the version. The string is not necessarily unique or localized (for example, the string could be \"1.4\")." } } }, @@ -436,7 +437,7 @@ "GroupLicense": { "id": "GroupLicense", "type": "object", - "description": "A group license object indicates a product that an enterprise admin has approved for use in the enterprise. The product may be free or paid. For free products, a group license object is created in these cases: if the enterprise admin approves a product in Google Play, if the product is added to a collection, or if an entitlement for the product is created for a user via the API. For paid products, a group license object is only created as part of the first bulk purchase of that product in Google Play done by the enterprise admin.\n\nThe API can be used to query group licenses; the available information includes the total number of licenses purchased (for paid products) and the total number of licenses that have been provisioned, i.e. the total number of user entitlements in existence for the product.\n\nGroup license objects are never deleted; if e.g. a free app is added to a collection and then removed, the group license will remain, allowing to keep track of any remaining entitlements. An enterprise admin may indicate they are no longer interested in the group license by marking it as unapproved in Google Play.", + "description": "A group license object indicates a product that an enterprise admin has approved for use in the enterprise. The product may be free or paid. For free products, a group license object is created in these cases: if the enterprise admin approves a product in Google Play, if the product is added to a collection, or if an entitlement for the product is created for a user via the API. For paid products, a group license object is only created as part of the first bulk purchase of that product in Google Play by the enterprise admin.\n\nThe API can be used to query group licenses; the available information includes the total number of licenses purchased (for paid products) and the total number of licenses that have been provisioned, that is, the total number of user entitlements in existence for the product.\n\nGroup license objects are never deleted. If, for example, a free app is added to a collection and then removed, the group license will remain, allowing the enterprise admin to keep track of any remaining entitlements. An enterprise admin may indicate they are no longer interested in the group license by marking it as unapproved in Google Play.", "properties": { "acquisitionKind": { "type": "string", @@ -580,7 +581,7 @@ "properties": { "appVersion": { "type": "array", - "description": "List of app versions available for this product. The returned list contains only public versions. E.g. alpha, beta or canary versions will not be included.", + "description": "App versions currently available for this product. The returned list contains only public versions. Alpha and beta versions are not included.", "items": { "$ref": "AppVersion" } @@ -595,7 +596,7 @@ }, "distributionChannel": { "type": "string", - "description": "How and to whom the package is made available." + "description": "How and to whom the package is made available. The value publicGoogleHosted means that the package is available through the Play Store and not restricted to a specific enterprise. The value privateGoogleHosted means that the package is a private app (restricted to an enterprise) but hosted by Google. The value privateSelfHosted means that the package is a private app (restricted to an enterprise) and is privately hosted." }, "iconUrl": { "type": "string", @@ -608,7 +609,7 @@ }, "productId": { "type": "string", - "description": "A string of the form \"app:\n\" - e.g. \"app:com.google.android.gm\" represents the GMail app." + "description": "A string of the form app:\n. For example, app:com.google.android.gm represents the Gmail app." }, "requiresContainerApp": { "type": "boolean", @@ -672,7 +673,8 @@ "type": "object", "properties": { "approvalUrlInfo": { - "$ref": "ApprovalUrlInfo" + "$ref": "ApprovalUrlInfo", + "description": "The approval URL that was shown to the user. Only the permissions shown to the user with that URL will be accepted, which may not be the product's entire set of permissions. For example, the URL may only display new permissions from an update after the product was approved, or not include new permissions if the product was updated since the URL was generated." } } }, @@ -682,7 +684,7 @@ "properties": { "url": { "type": "string", - "description": "A iframe-able URL that displays a product's permissions (if any). This URL can be used to approve the product only once and for a limited time (1 hour), using the Products.approve call. If the product is not currently approved and has no permissions, this URL will point to an empty page. If the product is currently approved and all of its permissions (if any) are also approved, this field will not be populated." + "description": "A URL that can be rendered in an iframe to display the permissions (if any) of a product. This URL can be used to approve the product only once and only within 24 hours of being generated, using the Products.approve call. If the product is currently unapproved and has no permissions, this URL will point to an empty page. If the product is currently approved, a URL will only be generated if that product has added permissions since it was last approved, and the URL will only display those new permissions that have not yet been accepted." } } }, @@ -1998,7 +2000,7 @@ "id": "androidenterprise.products.generateApprovalUrl", "path": "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl", "httpMethod": "POST", - "description": "Generates a URL that can be used to display an iframe to view the product's permissions (if any) and approve the product. This URL can be used to approve the product for a limited time (currently 1 hour) using the Products.approve call.", + "description": "Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product.\n\nAdmins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day.", "parameters": { "enterpriseId": { "type": "string", @@ -2008,7 +2010,7 @@ }, "languageCode": { "type": "string", - "description": "The language code that will be used for permission names and descriptions in the returned iframe.", + "description": "The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance \"en-US\".", "location": "query" }, "productId": { diff --git a/etc/api/api-list.yaml b/etc/api/api-list.yaml index ac13b2e52e..16b39532af 100644 --- a/etc/api/api-list.yaml +++ b/etc/api/api-list.yaml @@ -90,6 +90,8 @@ api: - v1management gan: - v1beta1 + genomics: + - v1 gmail: - v1 groupsmigration: diff --git a/etc/api/appstate/v1/appstate-api.json b/etc/api/appstate/v1/appstate-api.json index 65f8fd252f..9d3e54ef99 100644 --- a/etc/api/appstate/v1/appstate-api.json +++ b/etc/api/appstate/v1/appstate-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ak8oEX6cObVqcgf5lnMSd2yQgWQ\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/d2DWmPOjtaixnl3HTyCxzVi9ZWk\"", "discoveryVersion": "v1", "id": "appstate:v1", "name": "appstate", "canonicalName": "App State", "version": "v1", - "revision": "20150527", + "revision": "20150717", "title": "Google App State API", "description": "The Google App State API.", "ownerDomain": "google.com", diff --git a/etc/api/autoscaler/v1beta2/autoscaler-api.json b/etc/api/autoscaler/v1beta2/autoscaler-api.json index cc7ef03548..842730e65d 100644 --- a/etc/api/autoscaler/v1beta2/autoscaler-api.json +++ b/etc/api/autoscaler/v1beta2/autoscaler-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/cly7KQK-fjW4wH1MBNTB5Dx6wSc\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/YGxCrQRjuiCUCTofnn3s8ciKUBM\"", "discoveryVersion": "v1", "id": "autoscaler:v1beta2", "name": "autoscaler", "version": "v1beta2", - "revision": "20150617", + "revision": "20150629", "title": "Google Compute Engine Autoscaler API", "description": "The Google Compute Engine Autoscaler API provides autoscaling for groups of Cloud VMs.", "ownerDomain": "google.com", diff --git a/etc/api/bigquery/v2/bigquery-api.json b/etc/api/bigquery/v2/bigquery-api.json index 98ab1e2b4f..cd064b5a15 100644 --- a/etc/api/bigquery/v2/bigquery-api.json +++ b/etc/api/bigquery/v2/bigquery-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/dfyqUMrFd-mvh1ZHmWj5OJLDhTI\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/8fCXvMLivGaIg88cw7WCZo5CK_s\"", "discoveryVersion": "v1", "id": "bigquery:v2", "name": "bigquery", "version": "v2", - "revision": "20150526", + "revision": "20150720", "title": "BigQuery API", "description": "A data platform for customers to create, manage, share and query data.", "ownerDomain": "google.com", @@ -678,6 +678,13 @@ "description": "[Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. Moreover, the query cache is only available when a query does not have a destination table specified. The default value is true.", "default": "true" }, + "userDefinedFunctionResources": { + "type": "array", + "description": "[Experimental] Describes user-defined function resources used in the query.", + "items": { + "$ref": "UserDefinedFunctionResource" + } + }, "writeDisposition": { "type": "string", "description": "[Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion." @@ -1128,6 +1135,10 @@ "description": "[Output-only] The time when this table was last modified, in milliseconds since the epoch.", "format": "uint64" }, + "location": { + "type": "string", + "description": "[Optional] The backing storage location." + }, "numBytes": { "type": "string", "description": "[Output-only] The size of the table in bytes. This property is unavailable for tables that are actively receiving streaming inserts.", @@ -1410,6 +1421,20 @@ } } }, + "UserDefinedFunctionResource": { + "id": "UserDefinedFunctionResource", + "type": "object", + "properties": { + "inlineCode": { + "type": "string", + "description": "[Pick one] An inline resource that contains code for a user-defined function (UDF). Providing a inline code resource is equivalent to providing a URI for a file containing the same code." + }, + "resourceUri": { + "type": "string", + "description": "[Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path)." + } + } + }, "ViewDefinition": { "id": "ViewDefinition", "type": "object", @@ -1726,7 +1751,7 @@ }, "timeoutMs": { "type": "integer", - "description": "How long to wait for the query to complete, in milliseconds, before returning. Default is to return immediately. If the timeout passes before the job completes, the request will fail with a TIMEOUT error", + "description": "How long to wait for the query to complete, in milliseconds, before returning. Default is 10 seconds. If the timeout passes before the job completes, the 'jobComplete' field in the response will be false", "format": "uint32", "location": "query" } diff --git a/etc/api/calendar/v3/calendar-api.json b/etc/api/calendar/v3/calendar-api.json index 88edffa988..7b5e7a5565 100644 --- a/etc/api/calendar/v3/calendar-api.json +++ b/etc/api/calendar/v3/calendar-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/uB0KPjQ-_FKwri9S67F19ijFpA4\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/sTkwaf9z-97XKIcJuEmMVyvFBqI\"", "discoveryVersion": "v1", "id": "calendar:v3", "name": "calendar", "version": "v3", - "revision": "20150408", + "revision": "20150715", "title": "Calendar API", "description": "Lets you manipulate events and other calendar data.", "ownerDomain": "google.com", @@ -337,7 +337,7 @@ "properties": { "method": { "type": "string", - "description": "The method used to deliver the notification. Possible values are: \n- \"email\" - Reminders are sent via email. \n- \"sms\" - Reminders are sent via SMS. This value is read-only and is ignored on inserts and updates.", + "description": "The method used to deliver the notification. Possible values are: \n- \"email\" - Reminders are sent via email. \n- \"sms\" - Reminders are sent via SMS. This value is read-only and is ignored on inserts and updates. Furthermore, SMS reminders are only available for Google Apps for Work, Education, and Government customers.", "annotations": { "required": [ "calendar.calendarList.insert", @@ -478,6 +478,13 @@ "description": "Whether anyone can invite themselves to the event. Optional. The default is False.", "default": "false" }, + "attachments": { + "type": "array", + "description": "File attachments for the event. Currently only Google Drive attachments are supported.\nIn order to modify attachments the supportsAttachments request parameter should be set to true.\nThere can be at most 25 attachments per event,", + "items": { + "$ref": "EventAttachment" + } + }, "attendees": { "type": "array", "description": "The attendees of the event.", @@ -779,7 +786,36 @@ }, "EventAttachment": { "id": "EventAttachment", - "type": "object" + "type": "object", + "properties": { + "fileId": { + "type": "string", + "description": "ID of the attached file. Read-only.\nE.g. for Google Drive files this is the ID of the corresponding Files resource entry in the Drive API." + }, + "fileUrl": { + "type": "string", + "description": "URL link to the attachment.\nFor adding Google Drive file attachments use the same format as in alternateLink property of the Files resource in the Drive API.", + "annotations": { + "required": [ + "calendar.events.import", + "calendar.events.insert", + "calendar.events.update" + ] + } + }, + "iconLink": { + "type": "string", + "description": "URL link to the attachment's icon. Read-only." + }, + "mimeType": { + "type": "string", + "description": "Internet media type (MIME type) of the attachment." + }, + "title": { + "type": "string", + "description": "Attachment title." + } + } }, "EventAttendee": { "id": "EventAttendee", @@ -865,7 +901,7 @@ "properties": { "method": { "type": "string", - "description": "The method used by this reminder. Possible values are: \n- \"email\" - Reminders are sent via email. \n- \"sms\" - Reminders are sent via SMS. \n- \"popup\" - Reminders are sent via a UI popup.", + "description": "The method used by this reminder. Possible values are: \n- \"email\" - Reminders are sent via email. \n- \"sms\" - Reminders are sent via SMS. They are only available for Google Apps for Work, Education, and Government customers. Requests to set SMS reminders for the other accounts will be ignored. \n- \"popup\" - Reminders are sent via a UI popup.", "annotations": { "required": [ "calendar.calendarList.insert", @@ -1915,6 +1951,11 @@ "description": "Calendar identifier.", "required": true, "location": "path" + }, + "supportsAttachments": { + "type": "boolean", + "description": "Whether API client performing operation supports event attachments. Optional. The default is False.", + "location": "query" } }, "parameterOrder": [ @@ -1953,6 +1994,11 @@ "type": "boolean", "description": "Whether to send notifications about the creation of the new event. Optional. The default is False.", "location": "query" + }, + "supportsAttachments": { + "type": "boolean", + "description": "Whether API client performing operation supports event attachments. Optional. The default is False.", + "location": "query" } }, "parameterOrder": [ @@ -2254,6 +2300,11 @@ "type": "boolean", "description": "Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False.", "location": "query" + }, + "supportsAttachments": { + "type": "boolean", + "description": "Whether API client performing operation supports event attachments. Optional. The default is False.", + "location": "query" } }, "parameterOrder": [ @@ -2339,6 +2390,11 @@ "type": "boolean", "description": "Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False.", "location": "query" + }, + "supportsAttachments": { + "type": "boolean", + "description": "Whether API client performing operation supports event attachments. Optional. The default is False.", + "location": "query" } }, "parameterOrder": [ diff --git a/etc/api/civicinfo/v2/civicinfo-api.json b/etc/api/civicinfo/v2/civicinfo-api.json index 760af561a4..ea2caa6569 100644 --- a/etc/api/civicinfo/v2/civicinfo-api.json +++ b/etc/api/civicinfo/v2/civicinfo-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/COqImd_5mbMNjVXE2KjAxTFdRoU\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/79Y1HrgSgdJCTf1b4Qz0Z9zJqHE\"", "discoveryVersion": "v1", "id": "civicinfo:v2", "name": "civicinfo", "canonicalName": "Civic Info", "version": "v2", - "revision": "20150302", + "revision": "20150707", "title": "Google Civic Information API", "description": "An API for accessing civic information.", "ownerDomain": "google.com", @@ -275,10 +275,41 @@ "type": "string", "description": "If this is a partisan election, the name of the party it is for." }, + "referendumBallotResponses": { + "type": "array", + "description": "The set of ballot responses for the referendum. A ballot response represents a line on the ballot. Common examples might include \"yes\" or \"no\" for referenda, or a judge's name for a retention contest. This field is only populated for contests of type 'Referendum'.", + "items": { + "type": "string" + } + }, + "referendumBrief": { + "type": "string", + "description": "Specifies a short summary of the referendum that is on the ballot below the title but above the text. This field is only populated for contests of type 'Referendum'." + }, + "referendumConStatement": { + "type": "string", + "description": "A statement in opposition to the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type 'Referendum'." + }, + "referendumEffectOfAbstain": { + "type": "string", + "description": "Specifies what effect abstaining (not voting) on the proposition will have (i.e. whether abstaining is considered a vote against it). This field is only populated for contests of type 'Referendum'." + }, + "referendumPassageThreshold": { + "type": "string", + "description": "The threshold of votes that the referendum needs in order to pass, e.g. \"two-thirds\". This field is only populated for contests of type 'Referendum'." + }, + "referendumProStatement": { + "type": "string", + "description": "A statement in favor of the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type 'Referendum'." + }, "referendumSubtitle": { "type": "string", "description": "A brief description of the referendum. This field is only populated for contests of type 'Referendum'." }, + "referendumText": { + "type": "string", + "description": "The full text of the referendum. This field is only populated for contests of type 'Referendum'." + }, "referendumTitle": { "type": "string", "description": "The title of the referendum (e.g. 'Proposition 42'). This field is only populated for contests of type 'Referendum'." @@ -757,6 +788,10 @@ "description": "Identifies what kind of resource this is. Value: the fixed string \"civicinfo#voterInfoResponse\".", "default": "civicinfo#voterInfoResponse" }, + "mailOnly": { + "type": "boolean", + "description": "Specifies whether voters in the precinct vote only by mailing their ballots (with the possible option of dropping off their ballots as well)." + }, "normalizedInput": { "$ref": "SimpleAddressType", "description": "The normalized version of the requested address" diff --git a/etc/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json b/etc/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json index a7f458901e..c6b2d23a74 100644 --- a/etc/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json +++ b/etc/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/-ljPm2yVKKaBbJo9gwx1YPyHZqo\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/avMl03W4ktR_Q7PS4O3ogtyT8Dc\"", "discoveryVersion": "v1", "id": "cloudmonitoring:v2beta2", "name": "cloudmonitoring", "canonicalName": "Cloud Monitoring", "version": "v2beta2", - "revision": "20150616", + "revision": "20150713", "title": "Cloud Monitoring API", "description": "API for accessing Google Cloud and API monitoring data.", "ownerDomain": "google.com", @@ -70,6 +70,9 @@ "auth": { "oauth2": { "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, "https://www.googleapis.com/auth/monitoring": { "description": "View and write monitoring data for all of your Google and third-party Cloud and API projects" } @@ -522,6 +525,7 @@ "$ref": "MetricDescriptor" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/monitoring" ] }, @@ -552,6 +556,7 @@ "$ref": "DeleteMetricDescriptorResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/monitoring" ] }, @@ -597,6 +602,7 @@ "$ref": "ListMetricDescriptorsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/monitoring" ] } @@ -696,6 +702,7 @@ "$ref": "ListTimeseriesResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/monitoring" ] }, @@ -722,6 +729,7 @@ "$ref": "WriteTimeseriesResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/monitoring" ] } @@ -821,6 +829,7 @@ "$ref": "ListTimeseriesDescriptorsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/monitoring" ] } diff --git a/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json b/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json index 7b3d29959b..dbd325927e 100644 --- a/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json +++ b/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json @@ -1,13 +1,13 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Kw6n-qAgUnPZR8Gtqry3vxhHFsg\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/F20Fq1R-EfWlPIiQW_XhJNP4UeM\"", "discoveryVersion": "v1", "id": "cloudresourcemanager:v1beta1", "name": "cloudresourcemanager", "version": "v1beta1", - "revision": "20150603", + "revision": "20150711", "title": "Google Cloud Resource Manager API", - "description": "The Google Cloud Resource Manager API provides methods for creating, reading, and updating of project metadata, including IAM policies, and will shortly provide the same for other high-level entities (e.g. customers and resource groups). Longer term, we expect the cloudresourcemanager API to encompass other Cloud resources as well.", + "description": "The Google Cloud Resource Manager API provides methods for creating, reading, and updating of project metadata.", "ownerDomain": "google.com", "ownerName": "Google", "icons": { @@ -113,16 +113,16 @@ "Project": { "id": "Project", "type": "object", - "description": "A Project is a high-level Google Cloud Platform entity. It is a container for ACLs, APIs, AppEngine Apps, VMs, and other Google Cloud Platform resources. Projects are subordinate to Customers.", + "description": "A Project is a high-level Google Cloud Platform entity. It is a container for ACLs, APIs, AppEngine Apps, VMs, and other Google Cloud Platform resources.", "properties": { "projectNumber": { "type": "string", - "description": "The number uniquely identifying the project. Example: 415104041262. Read-only.", + "description": "The number uniquely identifying the project. Example: 415104041262 Read-only.", "format": "int64" }, "projectId": { "type": "string", - "description": "The unique, user-assigned id of the project. It must be 6 to 30 lowercase letters, digits, or hyphens. It must start with a letter. Trailing hyphens are prohibited. Example: \"tokyo-rain-123\" Read-only after creation." + "description": "The unique, user-assigned ID of the project. It must be 6 to 30 lowercase letters, digits, or hyphens. It must start with a letter. Trailing hyphens are prohibited. Example: tokyo-rain-123 Read-only after creation." }, "lifecycleState": { "type": "string", @@ -136,7 +136,7 @@ }, "name": { "type": "string", - "description": "The user-assigned name of the project. This field is optional and can remain unset. Allowed characters are: lower- and upper-case letters, numbers, hyphen, single-quote, double-quotes, space, and exclamation point. Example: \"My Project\" Read-write." + "description": "The user-assigned name of the project. This field is optional and can remain unset. Allowed characters are: lowercase and uppercase letters, numbers, hyphen, single-quote, double-quote, space, and exclamation point. Example: My Project Read-write." }, "createTime": { "type": "string", @@ -144,7 +144,7 @@ }, "labels": { "type": "object", - "description": "The labels associated with this project. Label keys must be between 1 and 63 characters long and must conform to the following regular expression: [a-z]([-a-z0-9]*[a-z0-9])?. Label values must be between 0 and 63 characters long and must conform to the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)?. No more than 256 labels can be associated with a given resource. Note that additional character may be included in labels in the future. Clients should store labels in a representation such as JSON that does not depend on specific characters being disallowed. Example: \"environment\" : \"dev\" Read-write.", + "description": "The labels associated with this project. Label keys must be between 1 and 63 characters long and must conform to the following regular expression: \\[a-z\\](\\[-a-z0-9\\]*\\[a-z0-9\\])?. Label values must be between 0 and 63 characters long and must conform to the regular expression (\\[a-z\\](\\[-a-z0-9\\]*\\[a-z0-9\\])?)?. No more than 256 labels can be associated with a given resource. Clients should store labels in a representation such as JSON that does not depend on specific characters being disallowed. Example: \"environment\" : \"dev\" Read-write.", "additionalProperties": { "type": "string" } @@ -154,7 +154,7 @@ "ListProjectsResponse": { "id": "ListProjectsResponse", "type": "object", - "description": "A page of the response received from the [ListProjects][cloudresourcemanager.projects.v1beta1.Projects.ListProjects] method. A paginated response where more pages are available has `next_page_token` set. This token can be used in a subsequent request to retrieve the next request page.", + "description": "A page of the response received from the [ListProjects][google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects] method. A paginated response where more pages are available has `next_page_token` set. This token can be used in a subsequent request to retrieve the next request page.", "properties": { "projects": { "type": "array", @@ -172,7 +172,7 @@ "Empty": { "id": "Empty", "type": "object", - "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }" + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`." } }, "resources": { @@ -212,7 +212,7 @@ }, "filter": { "type": "string", - "description": "An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: name id labels. where is a the name of a label Examples: name:* ==\u003e The project has a name. name:Howl ==\u003e The project’s name is `Howl` or 'howl'. name:HOWL ==\u003e Equivalent to above. NAME:howl ==\u003e Equivalent to above. labels.color:* ==\u003e The project has the label \"color\". labels.color:red ==\u003e The project’s label `color` has the value `red`. labels.color:red label.size:big ==\u003e The project's label `color` has the value `red` and its label `size` has the value `big`. Optional.", + "description": "An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: + `name` + `id` + labels.key where *key* is the name of a label Some examples of using labels as filters: |Filter|Description| |------|-----------| |name:*|The project has a name.| |name:Howl|The project's name is `Howl` or `howl`.| |name:HOWL|Equivalent to above.| |NAME:howl|Equivalent to above.| |labels.color:*|The project has the label `color`.| |labels.color:red|The project's label `color` has the value `red`.| |labels.color:red label.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. Optional.", "location": "query" } }, @@ -276,7 +276,7 @@ "id": "cloudresourcemanager.projects.delete", "path": "v1beta1/projects/{projectId}", "httpMethod": "DELETE", - "description": "Marks the project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the project if it has a lifecycle state of [ACTIVE][cloudresourcemanager.projects.v1beta2.LifecycleState.ACTIVE] when this method is called. Otherwise this method does nothing (since all other states are phases of deletion). This method changes the project's lifecycle state from [ACTIVE][cloudresourcemanager.projects.v1beta2.LifecycleState.ACTIVE] to [DELETE_REQUESTED] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_REQUESTED]. The deletion starts at an unspecified time, at which point the lifecycle state changes to [DELETE_IN_PROGRESS] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_IN_PROGRESS]. Until the deletion completes, you can check the lifecycle state checked by retrieving the project with [GetProject] [cloudresourcemanager.projects.v1beta2.Projects.GetProject], and the project remains visible to [ListProjects] [cloudresourcemanager.projects.v1beta2.Projects.ListProjects]. However, you cannot update the project. After the deletion completes, the project is not retrievable by the [GetProject] [cloudresourcemanager.projects.v1beta2.Projects.GetProject] and [ListProjects] [cloudresourcemanager.projects.v1beta2.Projects.ListProjects] methods. The caller must have modify permissions for this project.", + "description": "Marks the project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the project if the following criteria are met: + The project does not have a billing account associated with it. + The project has a lifecycle state of [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE]. This method changes the project's lifecycle state from [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE] to [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. The deletion starts at an unspecified time, at which point the lifecycle state changes to [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS]. Until the deletion completes, you can check the lifecycle state checked by retrieving the project with [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject], and the project remains visible to [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects]. However, you cannot update the project. After the deletion completes, the project is not retrievable by the [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject] and [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects] methods. The caller must have modify permissions for this project.", "parameters": { "projectId": { "type": "string", @@ -299,7 +299,7 @@ "id": "cloudresourcemanager.projects.undelete", "path": "v1beta1/projects/{projectId}:undelete", "httpMethod": "POST", - "description": "Restores the project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a project that has a lifecycle state of [DELETE_REQUESTED] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_REQUESTED]. After deletion starts, as indicated by a lifecycle state of [DELETE_IN_PROGRESS] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_IN_PROGRESS], the project cannot be restored. The caller must have modify permissions for this project.", + "description": "Restores the project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a project that has a lifecycle state of [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. After deletion starts, as indicated by a lifecycle state of [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS], the project cannot be restored. The caller must have modify permissions for this project.", "parameters": { "projectId": { "type": "string", diff --git a/etc/api/clouduseraccounts/alpha/clouduseraccounts-api.json b/etc/api/clouduseraccounts/alpha/clouduseraccounts-api.json index 2093381488..c10e039116 100644 --- a/etc/api/clouduseraccounts/alpha/clouduseraccounts-api.json +++ b/etc/api/clouduseraccounts/alpha/clouduseraccounts-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/_7ZaOXPJ-jAUoW6H7-tPOuF-gko\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/WIF6fk5SYSeRQS6nHRyvbx1cRUs\"", "discoveryVersion": "v1", "id": "clouduseraccounts:alpha", "name": "clouduseraccounts", "canonicalName": "Cloud User Accounts", "version": "alpha", - "revision": "20150619", + "revision": "20150714", "title": "Cloud User Accounts API", "description": "API for the Google Cloud User Accounts service.", "ownerDomain": "google.com", @@ -683,6 +683,7 @@ ], "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", "https://www.googleapis.com/auth/computeaccounts" ] }, @@ -735,6 +736,7 @@ }, "maxResults": { "type": "integer", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -743,6 +745,7 @@ }, "orderBy": { "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", "location": "query" }, "pageToken": { @@ -925,6 +928,7 @@ }, "maxResults": { "type": "integer", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -933,6 +937,7 @@ }, "orderBy": { "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", "location": "query" }, "pageToken": { @@ -1073,6 +1078,7 @@ }, "maxResults": { "type": "integer", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -1081,6 +1087,7 @@ }, "orderBy": { "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", "location": "query" }, "pageToken": { @@ -1095,12 +1102,6 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, - "user": { - "type": "string", - "description": "If provided, the user requesting the views. If left blank, the system is requesting the views, instead of a particular user.", - "pattern": "[a-z][-a-z0-9_]{0,31}", - "location": "query" - }, "zone": { "type": "string", "description": "Name of the zone for this request.", @@ -1278,6 +1279,7 @@ }, "maxResults": { "type": "integer", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -1286,6 +1288,7 @@ }, "orderBy": { "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", "location": "query" }, "pageToken": { diff --git a/etc/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json b/etc/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json index 467c0b469a..436cb3d237 100644 --- a/etc/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json +++ b/etc/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/k0bgAHzJI3AFP0ewt4BJ1NCB-jU\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/BpR07_0y6yfGK4qx0cJgXMHUdjo\"", "discoveryVersion": "v1", "id": "clouduseraccounts:vm_alpha", "name": "clouduseraccounts", "canonicalName": "Cloud User Accounts", "version": "vm_alpha", - "revision": "20150619", + "revision": "20150714", "title": "Cloud User Accounts API", "description": "API for the Google Cloud User Accounts service.", "ownerDomain": "google.com", @@ -683,6 +683,7 @@ ], "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", "https://www.googleapis.com/auth/computeaccounts" ] }, @@ -735,6 +736,7 @@ }, "maxResults": { "type": "integer", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -743,6 +745,7 @@ }, "orderBy": { "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", "location": "query" }, "pageToken": { @@ -925,6 +928,7 @@ }, "maxResults": { "type": "integer", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -933,6 +937,7 @@ }, "orderBy": { "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", "location": "query" }, "pageToken": { @@ -1073,6 +1078,7 @@ }, "maxResults": { "type": "integer", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -1081,6 +1087,7 @@ }, "orderBy": { "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", "location": "query" }, "pageToken": { @@ -1095,12 +1102,6 @@ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", "location": "path" }, - "user": { - "type": "string", - "description": "If provided, the user requesting the views. If left blank, the system is requesting the views, instead of a particular user.", - "pattern": "[a-z][-a-z0-9_]{0,31}", - "location": "query" - }, "zone": { "type": "string", "description": "Name of the zone for this request.", @@ -1278,6 +1279,7 @@ }, "maxResults": { "type": "integer", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -1286,6 +1288,7 @@ }, "orderBy": { "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", "location": "query" }, "pageToken": { diff --git a/etc/api/compute/v1/compute-api.json b/etc/api/compute/v1/compute-api.json index d161d80430..66f8046564 100644 --- a/etc/api/compute/v1/compute-api.json +++ b/etc/api/compute/v1/compute-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/KR3ZwQmcUACaSsWyMOhFw8te6OA\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/NXGE8K6l7s4gwLojFu4aKRPUYGk\"", "discoveryVersion": "v1", "id": "compute:v1", "name": "compute", "version": "v1", - "revision": "20150305", + "revision": "20150713", "title": "Compute Engine API", "description": "API for the Google Compute Engine service.", "ownerDomain": "google.com", @@ -434,6 +434,285 @@ } } }, + "Autoscaler": { + "id": "Autoscaler", + "type": "object", + "properties": { + "autoscalingPolicy": { + "$ref": "AutoscalingPolicy", + "description": "Autoscaling configuration." + }, + "creationTimestamp": { + "type": "string", + "description": "Creation timestamp in RFC3339 text format (output only)." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#autoscaler" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instanceGroups.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for the resource (output only)." + }, + "target": { + "type": "string", + "description": "URL of Instance Group Manager or Replica Pool which will be controlled by Autoscaler." + }, + "zone": { + "type": "string", + "description": "URL of the zone where the instance group resides (output only)." + } + } + }, + "AutoscalerAggregatedList": { + "id": "AutoscalerAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "object", + "description": "A map of scoped autoscaler lists.", + "additionalProperties": { + "$ref": "AutoscalersScopedList", + "description": "Name of the scope containing this set of autoscalers." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#autoscalerAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "AutoscalerList": { + "id": "AutoscalerList", + "type": "object", + "description": "Contains a list of persistent autoscaler resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "items": { + "type": "array", + "description": "A list of Autoscaler resources.", + "items": { + "$ref": "Autoscaler" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#autoscalerList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request (output only)." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "AutoscalersScopedList": { + "id": "AutoscalersScopedList", + "type": "object", + "properties": { + "autoscalers": { + "type": "array", + "description": "List of autoscalers contained in this scope.", + "items": { + "$ref": "Autoscaler" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of autoscalers when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "AutoscalingPolicy": { + "id": "AutoscalingPolicy", + "type": "object", + "description": "Cloud Autoscaler policy.", + "properties": { + "coolDownPeriodSec": { + "type": "integer", + "description": "The number of seconds that the Autoscaler should wait between two succeeding changes to the number of virtual machines. You should define an interval that is at least as long as the initialization time of a virtual machine and the time it may take for replica pool to create the virtual machine. The default is 60 seconds.", + "format": "int32" + }, + "cpuUtilization": { + "$ref": "AutoscalingPolicyCpuUtilization", + "description": "TODO(jbartosik): Add support for scaling based on muliple utilization metrics (take max recommendation). Exactly one utilization policy should be provided. Configuration parameters of CPU based autoscaling policy." + }, + "customMetricUtilizations": { + "type": "array", + "description": "Configuration parameters of autoscaling based on custom metric.", + "items": { + "$ref": "AutoscalingPolicyCustomMetricUtilization" + } + }, + "loadBalancingUtilization": { + "$ref": "AutoscalingPolicyLoadBalancingUtilization", + "description": "Configuration parameters of autoscaling based on load balancer." + }, + "maxNumReplicas": { + "type": "integer", + "description": "The maximum number of replicas that the Autoscaler can scale up to. This field is required for config to be effective. Maximum number of replicas should be not lower than minimal number of replicas. Absolute limit for this value is defined in Autoscaler backend.", + "format": "int32" + }, + "minNumReplicas": { + "type": "integer", + "description": "The minimum number of replicas that the Autoscaler can scale down to. Can't be less than 0. If not provided Autoscaler will choose default value depending on maximal number of replicas.", + "format": "int32" + } + } + }, + "AutoscalingPolicyCpuUtilization": { + "id": "AutoscalingPolicyCpuUtilization", + "type": "object", + "description": "CPU utilization policy.", + "properties": { + "utilizationTarget": { + "type": "number", + "description": "The target utilization that the Autoscaler should maintain. It is represented as a fraction of used cores. For example: 6 cores used in 8-core VM are represented here as 0.75. Must be a float value between (0, 1]. If not defined, the default is 0.8.", + "format": "double" + } + } + }, + "AutoscalingPolicyCustomMetricUtilization": { + "id": "AutoscalingPolicyCustomMetricUtilization", + "type": "object", + "description": "Custom utilization metric policy.", + "properties": { + "metric": { + "type": "string", + "description": "Identifier of the metric. It should be a Cloud Monitoring metric. The metric can not have negative values. The metric should be an utilization metric (increasing number of VMs handling requests x times should reduce average value of the metric roughly x times). For example you could use: compute.googleapis.com/instance/network/received_bytes_count." + }, + "utilizationTarget": { + "type": "number", + "description": "Target value of the metric which Autoscaler should maintain. Must be a positive value.", + "format": "double" + }, + "utilizationTargetType": { + "type": "string", + "description": "Defines type in which utilization_target is expressed.", + "enum": [ + "DELTA_PER_MINUTE", + "DELTA_PER_SECOND", + "GAUGE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "AutoscalingPolicyLoadBalancingUtilization": { + "id": "AutoscalingPolicyLoadBalancingUtilization", + "type": "object", + "description": "Load balancing utilization policy.", + "properties": { + "utilizationTarget": { + "type": "number", + "description": "Fraction of backend capacity utilization (set in HTTP load balancing configuration) that Autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. For example if your maxRatePerInstance capacity (in HTTP Load Balancing configuration) is set at 10 and you would like to keep number of instances such that each instance receives 7 QPS on average, set this to 0.7.", + "format": "double" + } + } + }, "Backend": { "id": "Backend", "type": "object", @@ -441,7 +720,7 @@ "properties": { "balancingMode": { "type": "string", - "description": "The balancing mode of this backend, default is UTILIZATION.", + "description": "Specifies the balancing mode for this backend. The default is UTILIZATION but available values are UTILIZATION and RATE.", "enum": [ "RATE", "UTILIZATION" @@ -453,16 +732,16 @@ }, "capacityScaler": { "type": "number", - "description": "The multiplier (a value between 0.0 and 1.0) of the max capacity (CPU or RPS, depending on 'balancingMode') the group should serve up to. 0 means the group is totally drained. Default value is 1. Valid range is [0.0, 1.0].", + "description": "A multiplier applied to the group's maximum servicing capacity (either UTILIZATION or RATE). Default value is 1, which means the group will serve up to 100% of its configured CPU or RPS (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available CPU or RPS. Valid range is [0.0,1.0].", "format": "float" }, "description": { "type": "string", - "description": "An optional textual description of the resource, which is provided by the client when the resource is created." + "description": "An optional textual description of the resource. Provided by the client when the resource is created." }, "group": { "type": "string", - "description": "URL of a zonal Cloud Resource View resource. This resource view defines the list of instances that serve traffic. Member virtual machine instances from each resource view must live in the same zone as the resource view itself. No two backends in a backend service are allowed to use same Resource View resource." + "description": "The fully-qualified URL of a zonal Instance Group resource. This instance group defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource.\n\nNote that you must specify an Instance Group resource using the fully-qualified URL, rather than a partial URL." }, "maxRate": { "type": "integer", @@ -476,7 +755,7 @@ }, "maxUtilization": { "type": "number", - "description": "Used when 'balancingMode' is UTILIZATION. This ratio defines the CPU utilization target for the group. The default is 0.8. Valid range is [0, 1].", + "description": "Used when balancingMode is UTILIZATION. This ratio defines the CPU utilization target for the group. The default is 0.8. Valid range is [0.0, 1.0].", "format": "float" } } @@ -484,7 +763,7 @@ "BackendService": { "id": "BackendService", "type": "object", - "description": "A BackendService resource. This resource defines a group of backend VMs together with their serving capacity.\n\nIf you add field foo, you probably need to also add: com.google.cloud.cluster.manager.api.BackendServiceResource: foo com.google.cloud.cluster.manager.networking.entities: BackendService, BackendServiceEntity: getFoo, setFoo:\n\nConverters/mappers will need to be updated: com.google.cloud.cluster.manager.networking.services.backendservice.BackendServiceResourceConverter: toResource, updateEntity: copy foo com.google.cloud.cluster.mixer.protomappers.BackendServiceMappers.ResourceMapper: ResourceMapper: add a new map call\n\nTests to update: com.google.cloud.cluster.manager.networking.services.backendservice.BackendServiceResourceConverterTest com.google.cloud.cluster.mixer.protomappers.BackendServiceMappersTest.testResourceMapping", + "description": "A BackendService resource. This resource defines a group of backend VMs together with their serving capacity.", "properties": { "backends": { "type": "array", @@ -495,11 +774,11 @@ }, "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", - "description": "An optional textual description of the resource; provided by the client when the resource is created." + "description": "An optional textual description of the resource. Provided by the client when the resource is created." }, "fingerprint": { "type": "string", @@ -515,22 +794,22 @@ }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", "format": "uint64" }, "kind": { "type": "string", - "description": "Type of the resource.", + "description": "[Output Only] Type of resource. Always compute#backendService for backend services.", "default": "compute#backendService" }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, "port": { "type": "integer", - "description": "Deprecated in favor of port_name. The TCP port to connect on the backend. The default value is 80.", + "description": "Deprecated in favor of port name. The TCP port to connect on the backend. The default value is 80.", "format": "int32" }, "portName": { @@ -548,7 +827,7 @@ }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server defined URL for the resource." }, "timeoutSec": { "type": "integer", @@ -569,7 +848,7 @@ }, "kind": { "type": "string", - "description": "Type of resource.", + "description": "[Output Only] Type of resource. Always compute#backendServiceGroupHealth for the health of backend services.", "default": "compute#backendServiceGroupHealth" } } @@ -581,7 +860,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -592,16 +871,16 @@ }, "kind": { "type": "string", - "description": "Type of resource.", + "description": "[Output Only] Type of resource. Always compute#backendServiceList for lists of backend services.", "default": "compute#backendServiceList" }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -1120,7 +1399,7 @@ }, "creationTimestamp": { "type": "string", - "description": "[Output Only] Creation timestamp in RFC3339text format." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", @@ -1157,21 +1436,21 @@ }, "sourceRanges": { "type": "array", - "description": "The IP address blocks that this rule applies to, expressed in CIDR format. One or both of sourceRanges and sourceTags may be set.\n\nIf both properties are set, an inbound connection is allowed if the range or the tag of the source matches the sourceRanges OR matches the sourceTags property; the connection does not need to match both properties.", + "description": "The IP address blocks that this rule applies to, expressed in CIDR format. One or both of sourceRanges and sourceTags may be set.\n\nIf both properties are set, an inbound connection is allowed if the range matches the sourceRanges OR the tag of the source matches the sourceTags property. The connection does not need to match both properties.", "items": { "type": "string" } }, "sourceTags": { "type": "array", - "description": "A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags may be set.\n\nIf both properties are set, an inbound connection is allowed if the range or the tag of the source matches the sourceRanges OR matches the sourceTags property; the connection does not need to match both properties.", + "description": "A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags may be set.\n\nIf both properties are set, an inbound connection is allowed if the range matches the sourceRanges OR the tag of the source matches the sourceTags property. The connection does not need to match both properties.", "items": { "type": "string" } }, "targetTags": { "type": "array", - "description": "A list of instance tags indicating sets of instances located on network which may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", + "description": "A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", "items": { "type": "string" } @@ -1220,7 +1499,7 @@ }, "IPProtocol": { "type": "string", - "description": "The IP protocol to which this rule applies, valid options are 'TCP', 'UDP', 'ESP', 'AH' or 'SCTP'.", + "description": "The IP protocol to which this rule applies, valid options are TCP, UDP, ESP, AH or SCTP.", "enum": [ "AH", "ESP", @@ -1238,7 +1517,7 @@ }, "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", @@ -1246,7 +1525,7 @@ }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", "format": "uint64" }, "kind": { @@ -1256,24 +1535,24 @@ }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, "portRange": { "type": "string", - "description": "Applicable only when 'IPProtocol' is 'TCP', 'UDP' or 'SCTP', only packets addressed to ports in the specified range will be forwarded to 'target'. If 'portRange' is left empty (default value), all ports are forwarded. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges." + "description": "Applicable only when `IPProtocol` is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. If portRange is left empty (default value), all ports are forwarded. Forwarding rules with the same `[IPAddress, IPProtocol]` pair must have disjoint port ranges." }, "region": { "type": "string", - "description": "URL of the region where the regional forwarding rule resides (output only). This field is not applicable to global forwarding rules." + "description": "[Output Only] URL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules." }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server-defined URL for the resource." }, "target": { "type": "string", - "description": "The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global TargetHttpProxy resource." + "description": "The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global TargetHttpProxy or TargetHttpsProxy resource." } } }, @@ -1283,7 +1562,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", @@ -1300,11 +1579,11 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server defined URL for this resource." } } }, @@ -1315,7 +1594,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource. Set by the server." }, "items": { "type": "array", @@ -1331,11 +1610,11 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server defined URL for this resource." } } }, @@ -1458,10 +1737,11 @@ "HostRule": { "id": "HostRule", "type": "object", - "description": "A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService.", + "description": "UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService.", "properties": { "description": { - "type": "string" + "type": "string", + "description": "An optional textual description." }, "hosts": { "type": "array", @@ -1472,7 +1752,7 @@ }, "pathMatcher": { "type": "string", - "description": "The name of the PathMatcher to match the path portion of the URL, if the this HostRule matches the URL's host portion." + "description": "The name of the PathMatcher to match the path portion of the URL, if the this hostRule matches the URL's host portion." } } }, @@ -1874,6 +2154,677 @@ } } }, + "InstanceGroup": { + "id": "InstanceGroup", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] The creation timestamp for this instance group in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional text description for the instance group." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the named ports information. The system uses this fingerprint to detect conflicts when multiple users change the named ports information concurrently.", + "format": "byte" + }, + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this instance group. The server defines this identifier.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroup for instance groups.", + "default": "compute#instanceGroup" + }, + "name": { + "type": "string", + "description": "The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "namedPorts": { + "type": "array", + "description": "Assigns a name to a port number. For example: {name: ?http?, port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: ?http?, port: 80},{name: \"http\", port: 8080}] Named ports apply to all instances in this instance group.", + "items": { + "$ref": "NamedPort" + } + }, + "network": { + "type": "string", + "description": "The URL of the network to which all instances in the instance group belong." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this instance group. The server defines this URL." + }, + "size": { + "type": "integer", + "description": "[Output Only] The total number of instances in the instance group.", + "format": "int32" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the instance group is located." + } + } + }, + "InstanceGroupAggregatedList": { + "id": "InstanceGroupAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this aggregated list of instance groups. The server defines this identifier." + }, + "items": { + "type": "object", + "description": "A map of scoped instance group lists.", + "additionalProperties": { + "$ref": "InstanceGroupsScopedList", + "description": "The name of the scope that contains this set of instance groups." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups.", + "default": "compute#instanceGroupAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] A unique identifier for this aggregated list of instance groups. The server defines this identifier." + } + } + }, + "InstanceGroupList": { + "id": "InstanceGroupList", + "type": "object", + "description": "A list of InstanceGroup resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this list of instance groups. The server defines this identifier." + }, + "items": { + "type": "array", + "description": "A list of InstanceGroup resources.", + "items": { + "$ref": "InstanceGroup" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupList for instance group lists.", + "default": "compute#instanceGroupList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this instance group. The server defines this URL." + } + } + }, + "InstanceGroupManager": { + "id": "InstanceGroupManager", + "type": "object", + "description": "InstanceGroupManagers\n\nNext available tag: 17", + "properties": { + "autoHealingPolicies": { + "type": "array", + "description": "The autohealing policy for this managed instance group. You can specify only one value.", + "items": { + "$ref": "InstanceGroupManagerAutoHealingPolicy" + } + }, + "baseInstanceName": { + "type": "string", + "description": "The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035.", + "pattern": "[a-z][-a-z0-9]{0,57}", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] The creation timestamp for this managed instance group in RFC3339 text format." + }, + "currentActions": { + "$ref": "InstanceGroupManagerActionsSummary", + "description": "[Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for those actions." + }, + "description": { + "type": "string", + "description": "An optional text description for the managed instance group." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when updating the target pool entries.", + "format": "byte" + }, + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this managed instance group. The server defines this identifier.", + "format": "uint64" + }, + "instanceGroup": { + "type": "string", + "description": "[Output Only] The URL of the InstanceGroup resource." + }, + "instanceTemplate": { + "type": "string", + "description": "The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group.", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.", + "default": "compute#instanceGroupManager" + }, + "name": { + "type": "string", + "description": "The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this managed instance group." + }, + "targetPools": { + "type": "array", + "description": "The URL of all TargetPool resources to which new instances in the instanceGroup field are added. Updating the target pool values does not affect existing instances.", + "items": { + "type": "string" + } + }, + "targetSize": { + "type": "integer", + "description": "The target number of running instances for this managed instance group. Deleting or abandoning instances reduces this number. Resizing the group changes this number.", + "format": "int32", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the managed instance group is located." + } + } + }, + "InstanceGroupManagerActionsSummary": { + "id": "InstanceGroupManagerActionsSummary", + "type": "object", + "properties": { + "abandoning": { + "type": "integer", + "format": "int32" + }, + "creating": { + "type": "integer", + "format": "int32" + }, + "deleting": { + "type": "integer", + "format": "int32" + }, + "none": { + "type": "integer", + "format": "int32" + }, + "recreating": { + "type": "integer", + "format": "int32" + }, + "refreshing": { + "type": "integer", + "format": "int32" + }, + "restarting": { + "type": "integer", + "format": "int32" + } + } + }, + "InstanceGroupManagerAggregatedList": { + "id": "InstanceGroupManagerAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this aggregated list of managed instance groups. The server defines this identifier." + }, + "items": { + "type": "object", + "description": "A map of filtered managed instance group lists.", + "additionalProperties": { + "$ref": "InstanceGroupManagersScopedList", + "description": "The name of the scope that contains this set of managed instance groups." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups.", + "default": "compute#instanceGroupManagerAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this aggregated list of managed instance groups. The server defines this URL." + } + } + }, + "InstanceGroupManagerAutoHealingPolicy": { + "id": "InstanceGroupManagerAutoHealingPolicy", + "type": "object", + "properties": { + "actionType": { + "type": "string", + "description": "The action to perform when an instance becomes unhealthy. Possible values are RECREATE or RESTART. RECREATE replaces an unhealthy instance with a new instance that is based on the instance template for this managed instance group. RESTART performs a soft restart on an instance. If the instance cannot restart softly, the instance performs a hard restart.", + "enum": [ + "RECREATE", + "RESTART" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "healthCheck": { + "type": "string", + "description": "The URL for the HealthCheck that signals autohealing." + } + } + }, + "InstanceGroupManagerList": { + "id": "InstanceGroupManagerList", + "type": "object", + "description": "[Output Only] A list of InstanceGroupManager resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this managed instance group. The server defines this identifier." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of managed instance group resources.", + "items": { + "$ref": "InstanceGroupManager" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#instanceGroupManagerList for a list of managed instance group resources.", + "default": "compute#instanceGroupManagerList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this managed instance group. The server defines this URL." + } + } + }, + "InstanceGroupManagersAbandonInstancesRequest": { + "id": "InstanceGroupManagersAbandonInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The names of instances to abandon from the managed instance group.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersDeleteInstancesRequest": { + "id": "InstanceGroupManagersDeleteInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The names of one or more instances to delete.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersListManagedInstancesResponse": { + "id": "InstanceGroupManagersListManagedInstancesResponse", + "type": "object", + "properties": { + "managedInstances": { + "type": "array", + "description": "List of managed instances. If empty - all instances are listed.", + "items": { + "$ref": "ManagedInstance" + } + } + } + }, + "InstanceGroupManagersRecreateInstancesRequest": { + "id": "InstanceGroupManagersRecreateInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The names of one or more instances to recreate.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersScopedList": { + "id": "InstanceGroupManagersScopedList", + "type": "object", + "properties": { + "instanceGroupManagers": { + "type": "array", + "description": "[Output Only] The list of managed instance groups that are contained in the specified project and zone.", + "items": { + "$ref": "InstanceGroupManager" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] The warning that replaces the list of managed instance groups when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "InstanceGroupManagersSetInstanceTemplateRequest": { + "id": "InstanceGroupManagersSetInstanceTemplateRequest", + "type": "object", + "properties": { + "instanceTemplate": { + "type": "string", + "description": "The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group." + } + } + }, + "InstanceGroupManagersSetTargetPoolsRequest": { + "id": "InstanceGroupManagersSetTargetPoolsRequest", + "type": "object", + "properties": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when updating the target pool entries.", + "format": "byte" + }, + "targetPools": { + "type": "array", + "description": "The list of target pool URLs that instances in this managed instance group belong to. When the managed instance group creates new instances, the group automatically adds those instances to the target pools that are specified in this parameter. Changing the value of this parameter does not change the target pools of existing instances in this managed instance group.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupsAddInstancesRequest": { + "id": "InstanceGroupsAddInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The instances to add to the instance group.", + "items": { + "$ref": "InstanceReference" + } + } + } + }, + "InstanceGroupsListInstances": { + "id": "InstanceGroupsListInstances", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this list of instance groups. The server defines this identifier." + }, + "items": { + "type": "array", + "description": "A list of InstanceWithNamedPorts resources, which contains all named ports for the given instance.", + "items": { + "$ref": "InstanceWithNamedPorts" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupsListInstances for lists of instance groups.", + "default": "compute#instanceGroupsListInstances" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this list of instance groups. The server defines this URL." + } + } + }, + "InstanceGroupsListInstancesRequest": { + "id": "InstanceGroupsListInstancesRequest", + "type": "object", + "properties": { + "instanceState": { + "type": "string", + "description": "A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state.", + "enum": [ + "ALL", + "RUNNING" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "portName": { + "type": "string", + "description": "A filter for the named ports that are associated with instances in the instance group. If you specify this parameter, the generated list includes only instances that are associated with the specified named ports. If you do not specify this parameter, the generated list includes all instances regardless of their named ports.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + } + } + }, + "InstanceGroupsRemoveInstancesRequest": { + "id": "InstanceGroupsRemoveInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The instances to remove from the instance group.", + "items": { + "$ref": "InstanceReference" + } + } + } + }, + "InstanceGroupsScopedList": { + "id": "InstanceGroupsScopedList", + "type": "object", + "properties": { + "instanceGroups": { + "type": "array", + "description": "[Output Only] The list of instance groups that are contained in this scope.", + "items": { + "$ref": "InstanceGroup" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] An informational warning that replaces the list of instance groups when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "InstanceGroupsSetNamedPortsRequest": { + "id": "InstanceGroupsSetNamedPortsRequest", + "type": "object", + "properties": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the named ports information, which is a hash of the contents. Use this field for optimistic locking when you update the named ports entries.", + "format": "byte" + }, + "namedPorts": { + "type": "array", + "description": "The list of named ports to set for this instance group.", + "items": { + "$ref": "NamedPort" + } + } + } + }, "InstanceList": { "id": "InstanceList", "type": "object", @@ -2059,6 +3010,47 @@ } } }, + "InstanceWithNamedPorts": { + "id": "InstanceWithNamedPorts", + "type": "object", + "properties": { + "instance": { + "type": "string", + "description": "The URL of the instance." + }, + "namedPorts": { + "type": "array", + "description": "The named ports that belong to this instance group.", + "items": { + "$ref": "NamedPort" + } + }, + "status": { + "type": "string", + "description": "The status of the instance.", + "enum": [ + "PROVISIONING", + "RUNNING", + "STAGING", + "STOPPED", + "STOPPING", + "SUSPENDED", + "SUSPENDING", + "TERMINATED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, "InstancesScopedList": { "id": "InstancesScopedList", "type": "object", @@ -2384,6 +3376,104 @@ } } }, + "ManagedInstance": { + "id": "ManagedInstance", + "type": "object", + "properties": { + "currentAction": { + "type": "string", + "description": "The current action that the managed instance group has scheduled for the instance.", + "enum": [ + "ABANDONING", + "CREATING", + "DELETING", + "NONE", + "RECREATING", + "REFRESHING", + "RESTARTING" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "id": { + "type": "string", + "description": "The unique identifier for this resource (empty when instance does not exist).", + "format": "uint64" + }, + "instance": { + "type": "string", + "description": "The URL of the instance (set even though instance does not exist yet)." + }, + "instanceStatus": { + "type": "string", + "description": "The status of the instance (empty when instance does not exist).", + "enum": [ + "PROVISIONING", + "RUNNING", + "STAGING", + "STOPPED", + "STOPPING", + "SUSPENDED", + "SUSPENDING", + "TERMINATED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "lastAttempt": { + "$ref": "ManagedInstanceLastAttempt", + "description": "Information about the last attempt to create or delete the instance." + } + } + }, + "ManagedInstanceLastAttempt": { + "id": "ManagedInstanceLastAttempt", + "type": "object", + "properties": { + "errors": { + "type": "object", + "description": "Encountered errors during the last attempt to create or delete the instance.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + } + } + }, "Metadata": { "id": "Metadata", "type": "object", @@ -2431,6 +3521,23 @@ } } }, + "NamedPort": { + "id": "NamedPort", + "type": "object", + "description": "The named port information. For example: .", + "properties": { + "name": { + "type": "string", + "description": "The name for this NamedPort.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "port": { + "type": "integer", + "description": "The port number, which can be a value between 1 and 65535.", + "format": "int32" + } + } + }, "Network": { "id": "Network", "type": "object", @@ -2452,7 +3559,7 @@ }, "description": { "type": "string", - "description": "An optional textual description of the resource; provided by the client when the resource is created." + "description": "An optional textual description of the resource. Provided by the client when the resource is created." }, "gatewayIPv4": { "type": "string", @@ -2461,7 +3568,7 @@ }, "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", "format": "uint64" }, "kind": { @@ -2471,7 +3578,7 @@ }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "annotations": { "required": [ @@ -2523,7 +3630,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource; defined by the server." + "description": "[Output Only] Unique identifier for the resource. Defined by the server." }, "items": { "type": "array", @@ -2550,11 +3657,11 @@ "Operation": { "id": "Operation", "type": "object", - "description": "An operation resource, used to manage asynchronous API requests.", + "description": "An Operation resource, used to manage asynchronous API requests.", "properties": { "clientOperationId": { "type": "string", - "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project." + "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project." }, "creationTimestamp": { "type": "string", @@ -2776,7 +3883,7 @@ "OperationList": { "id": "OperationList", "type": "object", - "description": "Contains a list of operation resources.", + "description": "Contains a list of Operation resources.", "properties": { "id": { "type": "string", @@ -2784,7 +3891,7 @@ }, "items": { "type": "array", - "description": "[Output Only] The operation resources.", + "description": "[Output Only] The Operation resources.", "items": { "$ref": "Operation" } @@ -2890,7 +3997,8 @@ "description": "The URL to the BackendService resource. This will be used if none of the 'pathRules' defined by this PathMatcher is met by the URL's path portion." }, "description": { - "type": "string" + "type": "string", + "description": "An optional textual description of the resource." }, "name": { "type": "string", @@ -2993,6 +4101,8 @@ "HEALTH_CHECKS", "IMAGES", "INSTANCES", + "INSTANCE_GROUPS", + "INSTANCE_GROUP_MANAGERS", "INSTANCE_TEMPLATES", "IN_USE_ADDRESSES", "LOCAL_SSD_TOTAL_GB", @@ -3030,6 +4140,8 @@ "", "", "", + "", + "", "" ] }, @@ -3147,19 +4259,19 @@ "Route": { "id": "Route", "type": "object", - "description": "The route resource. A Route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with VMs by tag and the set of Routes for a particular VM is called its routing table. For each packet leaving a VM, the system searches that VM's routing table for a single best matching Route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the Route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching Routes. The packet is then forwarded as specified by the next_hop field of the winning Route -- either to another VM destination, a VM gateway or a GCE operated gateway. Packets that do not match any Route in the sending VM's routing table will be dropped.", + "description": "The route resource. A Route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with VMs by tag and the set of Routes for a particular VM is called its routing table. For each packet leaving a VM, the system searches that VM's routing table for a single best matching Route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the Route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching Routes. The packet is then forwarded as specified by the nextHop field of the winning Route -- either to another VM destination, a VM gateway or a GCE operated gateway. Packets that do not match any Route in the sending VM's routing table are dropped.", "properties": { "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", - "description": "An optional textual description of the resource; provided by the client when the resource is created." + "description": "An optional textual description of the resource. Provided by the client when the resource is created." }, "destRange": { "type": "string", - "description": "Which packets does this route apply to?", + "description": "The destination range of outgoing packets that this route applies to.", "annotations": { "required": [ "compute.routes.insert" @@ -3168,17 +4280,17 @@ }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", "format": "uint64" }, "kind": { "type": "string", - "description": "Type of the resource.", + "description": "[Output Only] Type of this resource. Always compute#routes for Route resources.", "default": "compute#route" }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "annotations": { "required": [ @@ -3188,7 +4300,7 @@ }, "network": { "type": "string", - "description": "URL of the network to which this route is applied; provided by the client when the route is created.", + "description": "Fully-qualified URL of the network that this route applies to.", "annotations": { "required": [ "compute.routes.insert" @@ -3197,11 +4309,11 @@ }, "nextHopGateway": { "type": "string", - "description": "The URL to a gateway that should handle matching packets." + "description": "The URL to a gateway that should handle matching packets. Currently, this is only the internet gateway: projects/\u003cproject-id\u003e/global/gateways/default-internet-gateway" }, "nextHopInstance": { "type": "string", - "description": "The URL to an instance that should handle matching packets." + "description": "The fully-qualified URL to an instance that should handle matching packets. For example:\nhttps://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/" }, "nextHopIp": { "type": "string", @@ -3227,7 +4339,7 @@ }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server-defined fully-qualified URL for this resource." }, "tags": { "type": "array", @@ -3243,7 +4355,7 @@ }, "warnings": { "type": "array", - "description": "If potential misconfigurations are detected for this route, this field will be populated with warning messages.", + "description": "[Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages.", "items": { "type": "object", "properties": { @@ -3316,7 +4428,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource. Defined by the server." }, "items": { "type": "array", @@ -3332,11 +4444,11 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server defined URL for this resource." } } }, @@ -3412,7 +4524,7 @@ "properties": { "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", @@ -3420,17 +4532,17 @@ }, "diskSizeGb": { "type": "string", - "description": "Size of the persistent disk snapshot, specified in GB (output only).", + "description": "[Output Only] Size of the snapshot, specified in GB.", "format": "int64" }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", "format": "uint64" }, "kind": { "type": "string", - "description": "Type of the resource.", + "description": "[Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.", "default": "compute#snapshot" }, "licenses": { @@ -3442,12 +4554,12 @@ }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server-defined URL for the resource." }, "sourceDisk": { "type": "string", @@ -3455,11 +4567,11 @@ }, "sourceDiskId": { "type": "string", - "description": "The 'id' value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name." + "description": "[Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name." }, "status": { "type": "string", - "description": "The status of the persistent disk snapshot (output only).", + "description": "[Output Only] The status of the snapshot.", "enum": [ "CREATING", "DELETING", @@ -3477,12 +4589,12 @@ }, "storageBytes": { "type": "string", - "description": "A size of the the storage used by the snapshot. As snapshots share storage this number is expected to change with snapshot creation/deletion.", + "description": "[Output Only] A size of the the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.", "format": "int64" }, "storageBytesStatus": { "type": "string", - "description": "An indicator whether storageBytes is in a stable state, or it is being adjusted as a result of shared storage reallocation.", + "description": "[Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation.", "enum": [ "UPDATING", "UP_TO_DATE" @@ -3497,7 +4609,7 @@ "SnapshotList": { "id": "SnapshotList", "type": "object", - "description": "Contains a list of persistent disk snapshot resources.", + "description": "Contains a list of Snapshot resources.", "properties": { "id": { "type": "string", @@ -3551,7 +4663,7 @@ "properties": { "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", @@ -3559,22 +4671,22 @@ }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", "format": "uint64" }, "kind": { "type": "string", - "description": "Type of the resource.", + "description": "[Output Only] Type of resource. Always compute#Operation for Operation resources.", "default": "compute#targetHttpProxy" }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server defined URL for the resource." }, "urlMap": { "type": "string", @@ -3585,11 +4697,11 @@ "TargetHttpProxyList": { "id": "TargetHttpProxyList", "type": "object", - "description": "Contains a list of TargetHttpProxy resources.", + "description": "A list of TargetHttpProxy resources.", "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -3600,16 +4712,16 @@ }, "kind": { "type": "string", - "description": "Type of resource.", + "description": "Type of resource. Always compute#targetHttpProxyList for lists of Target HTTP proxies.", "default": "compute#targetHttpProxyList" }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -4125,7 +5237,7 @@ }, "name": { "type": "string", - "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long and comply with RFC1035.", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "annotations": { "required": [ @@ -4338,7 +5450,7 @@ "properties": { "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "defaultService": { "type": "string", @@ -4346,7 +5458,7 @@ }, "description": { "type": "string", - "description": "An optional textual description of the resource; provided by the client when the resource is created." + "description": "An optional textual description of the resource. Provided by the client when the resource is created." }, "fingerprint": { "type": "string", @@ -4362,7 +5474,7 @@ }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource. Set by the server.", "format": "uint64" }, "kind": { @@ -4372,7 +5484,7 @@ }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, "pathMatchers": { @@ -4384,7 +5496,7 @@ }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server defined URL for the resource." }, "tests": { "type": "array", @@ -4402,7 +5514,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource. Set by the server." }, "items": { "type": "array", @@ -4418,11 +5530,11 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server defined URL for this resource." } } }, @@ -4559,7 +5671,7 @@ }, "name": { "type": "string", - "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long and comply with RFC1035.", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "annotations": { "required": [ @@ -4600,6 +5712,7 @@ "NETWORK_ERROR", "NO_INCOMING_PACKETS", "PROVISIONING", + "REJECTED", "WAITING_FOR_FULL_CONFIG" ], "enumDescriptions": [ @@ -4612,6 +5725,7 @@ "", "", "", + "", "" ] }, @@ -4885,7 +5999,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -4899,7 +6013,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5049,7 +6163,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -5063,7 +6177,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5096,6 +6210,313 @@ } } }, + "autoscalers": { + "methods": { + "aggregatedList": { + "id": "compute.autoscalers.aggregatedList", + "path": "{project}/aggregated/autoscalers", + "httpMethod": "GET", + "description": "Retrieves the list of autoscalers grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "AutoscalerAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.autoscalers.delete", + "path": "{project}/zones/{zone}/autoscalers/{autoscaler}", + "httpMethod": "DELETE", + "description": "Deletes the specified autoscaler resource.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the persistent autoscaler resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "autoscaler" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.autoscalers.get", + "path": "{project}/zones/{zone}/autoscalers/{autoscaler}", + "httpMethod": "GET", + "description": "Returns the specified autoscaler resource.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the persistent autoscaler resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "autoscaler" + ], + "response": { + "$ref": "Autoscaler" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.autoscalers.insert", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "POST", + "description": "Creates an autoscaler resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.autoscalers.list", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "GET", + "description": "Retrieves the list of autoscaler resources contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "AutoscalerList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.autoscalers.patch", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "PATCH", + "description": "Updates an autoscaler resource in the specified project using the data included in the request. This method supports patch semantics.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the autoscaler resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "autoscaler" + ], + "request": { + "$ref": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.autoscalers.update", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "PUT", + "description": "Updates an autoscaler resource in the specified project using the data included in the request.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the autoscaler resource to update.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, "backendServices": { "methods": { "delete": { @@ -5237,7 +6658,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -5251,7 +6672,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5358,7 +6779,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -5372,7 +6793,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5445,7 +6866,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -5459,7 +6880,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5502,7 +6923,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -5516,7 +6937,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5587,7 +7008,7 @@ "id": "compute.disks.delete", "path": "{project}/zones/{zone}/disks/{disk}", "httpMethod": "DELETE", - "description": "Deletes the specified persistent disk.", + "description": "Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.", "parameters": { "disk": { "type": "string", @@ -5715,7 +7136,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -5729,7 +7150,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5867,7 +7288,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -5881,7 +7302,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5988,7 +7409,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -6002,7 +7423,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -6152,7 +7573,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -6166,7 +7587,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -6348,7 +7769,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -6362,7 +7783,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -6492,7 +7913,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -6506,7 +7927,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -6577,7 +7998,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -6591,7 +8012,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -6618,11 +8039,11 @@ "id": "compute.globalOperations.delete", "path": "{project}/global/operations/{operation}", "httpMethod": "DELETE", - "description": "Deletes the specified operation resource.", + "description": "Deletes the specified Operations resource.", "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to delete.", + "description": "Name of the Operations resource to delete.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -6648,11 +8069,11 @@ "id": "compute.globalOperations.get", "path": "{project}/global/operations/{operation}", "httpMethod": "GET", - "description": "Retrieves the specified operation resource.", + "description": "Retrieves the specified Operations resource.", "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to return.", + "description": "Name of the Operations resource to return.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -6682,11 +8103,11 @@ "id": "compute.globalOperations.list", "path": "{project}/global/operations", "httpMethod": "GET", - "description": "Retrieves the list of operation resources contained within the specified project.", + "description": "Retrieves the list of Operation resources contained within the specified project.", "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -6700,7 +8121,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -6830,7 +8251,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -6844,7 +8265,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -7085,7 +8506,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -7099,7 +8520,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -7124,6 +8545,921 @@ } } }, + "instanceGroupManagers": { + "methods": { + "abandonInstances": { + "id": "compute.instanceGroupManagers.abandonInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", + "httpMethod": "POST", + "description": "Removes the specified instances from the managed instance group, and from any target pools where they are a member. The instances are not deleted. The managed instance group automatically reduces its targetSize value by the number of instances that you abandon from the group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersAbandonInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.instanceGroupManagers.aggregatedList", + "path": "{project}/aggregated/instanceGroupManagers", + "httpMethod": "GET", + "description": "Retrieves the list of managed instance groups, and groups them by project and zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "InstanceGroupManagerAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.instanceGroupManagers.delete", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + "httpMethod": "DELETE", + "description": "Deletes the specified managed instance group resource.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager to delete.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "deleteInstances": { + "id": "compute.instanceGroupManagers.deleteInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", + "httpMethod": "POST", + "description": "Deletes the specified instances. The instances are deleted and removed from the instance group and any target pools where they are a member. The managed instance group automatically reduces its targetSize value by the number of instances that you delete.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersDeleteInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instanceGroupManagers.get", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + "httpMethod": "GET", + "description": "Returns the specified managed instance group resource.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager resource.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "InstanceGroupManager" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instanceGroupManagers.insert", + "path": "{project}/zones/{zone}/instanceGroupManagers", + "httpMethod": "POST", + "description": "Creates a managed instance group resource in the specified project using the data that is included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "InstanceGroupManager" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instanceGroupManagers.list", + "path": "{project}/zones/{zone}/instanceGroupManagers", + "httpMethod": "GET", + "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "InstanceGroupManagerList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "listManagedInstances": { + "id": "compute.instanceGroupManagers.listManagedInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances", + "httpMethod": "POST", + "description": "Lists managed instances.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "InstanceGroupManagersListManagedInstancesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "recreateInstances": { + "id": "compute.instanceGroupManagers.recreateInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", + "httpMethod": "POST", + "description": "Recreates the specified instances. The instances are deleted, then recreated using the managed instance group's current instance template.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersRecreateInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "resize": { + "id": "compute.instanceGroupManagers.resize", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize", + "httpMethod": "POST", + "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group removes instances in the order that is outlined in Resizing a managed instance group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "size": { + "type": "integer", + "description": "The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.", + "required": true, + "format": "int32", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager", + "size" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setInstanceTemplate": { + "id": "compute.instanceGroupManagers.setInstanceTemplate", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", + "httpMethod": "POST", + "description": "Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersSetInstanceTemplateRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setTargetPools": { + "id": "compute.instanceGroupManagers.setTargetPools", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools", + "httpMethod": "POST", + "description": "Modifies the target pools to which all new instances in this group are assigned. The target pools for existing instances in the group do not change unless you recreate them.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersSetTargetPoolsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "instanceGroups": { + "methods": { + "addInstances": { + "id": "compute.instanceGroups.addInstances", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances", + "httpMethod": "POST", + "description": "Adds a list of instances to an instance group. All of the instances in the instance group must be in the same network.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group where you are adding instances.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsAddInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.instanceGroups.aggregatedList", + "path": "{project}/aggregated/instanceGroups", + "httpMethod": "GET", + "description": "Retrieves the list of instance groups, and sorts them by zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "InstanceGroupAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.instanceGroups.delete", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + "httpMethod": "DELETE", + "description": "Deletes the specified instance group.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group to delete.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instanceGroups.get", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + "httpMethod": "GET", + "description": "Returns the specified instance group resource.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "response": { + "$ref": "InstanceGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instanceGroups.insert", + "path": "{project}/zones/{zone}/instanceGroups", + "httpMethod": "POST", + "description": "Creates an instance group in the specified project using the parameters that are included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "InstanceGroup" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instanceGroups.list", + "path": "{project}/zones/{zone}/instanceGroups", + "httpMethod": "GET", + "description": "Retrieves the list of instance groups that are located in the specified project and zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "InstanceGroupList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "listInstances": { + "id": "compute.instanceGroups.listInstances", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances", + "httpMethod": "POST", + "description": "Lists instances in an instance group. The parameters for this method specify whether the list filters instances by state and named ports information.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", + "location": "query" + }, + "instanceGroup": { + "type": "string", + "description": "The name of the instance group from which you want to generate a list of included instances.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsListInstancesRequest" + }, + "response": { + "$ref": "InstanceGroupsListInstances" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "removeInstances": { + "id": "compute.instanceGroups.removeInstances", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances", + "httpMethod": "POST", + "description": "Removes a list of instances from an instance group.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group where the specified instances will be removed.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsRemoveInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setNamedPorts": { + "id": "compute.instanceGroups.setNamedPorts", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts", + "httpMethod": "POST", + "description": "Sets the named ports in an instance group.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group where the named ports are updated.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The URL of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsSetNamedPortsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, "instanceTemplates": { "methods": { "delete": { @@ -7229,7 +9565,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -7243,7 +9579,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -7328,7 +9664,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -7342,7 +9678,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -7611,7 +9947,7 @@ }, "port": { "type": "integer", - "description": "Which COM port to retrieve data from.", + "description": "Specifies which COM or serial port to retrieve data from.", "default": "1", "format": "int32", "minimum": "1", @@ -7691,7 +10027,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -7705,7 +10041,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8097,7 +10433,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -8111,7 +10447,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8184,7 +10520,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -8198,7 +10534,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8336,7 +10672,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -8350,7 +10686,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8526,11 +10862,11 @@ "id": "compute.regionOperations.delete", "path": "{project}/regions/{region}/operations/{operation}", "httpMethod": "DELETE", - "description": "Deletes the specified region-specific operation resource.", + "description": "Deletes the specified region-specific Operations resource.", "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to delete.", + "description": "Name of the Operations resource to delete.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -8564,11 +10900,11 @@ "id": "compute.regionOperations.get", "path": "{project}/regions/{region}/operations/{operation}", "httpMethod": "GET", - "description": "Retrieves the specified region-specific operation resource.", + "description": "Retrieves the specified region-specific Operations resource.", "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to return.", + "description": "Name of the Operations resource to return.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -8606,11 +10942,11 @@ "id": "compute.regionOperations.list", "path": "{project}/regions/{region}/operations", "httpMethod": "GET", - "description": "Retrieves the list of operation resources contained within the specified region.", + "description": "Retrieves the list of Operation resources contained within the specified region.", "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -8624,7 +10960,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8701,7 +11037,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -8715,7 +11051,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8845,7 +11181,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -8859,7 +11195,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8890,7 +11226,7 @@ "id": "compute.snapshots.delete", "path": "{project}/global/snapshots/{snapshot}", "httpMethod": "DELETE", - "description": "Deletes the specified persistent disk snapshot resource.", + "description": "Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot.\n\nFor more information, see Deleting snaphots.", "parameters": { "project": { "type": "string", @@ -8901,7 +11237,7 @@ }, "snapshot": { "type": "string", - "description": "Name of the persistent disk snapshot resource to delete.", + "description": "Name of the Snapshot resource to delete.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -8923,7 +11259,7 @@ "id": "compute.snapshots.get", "path": "{project}/global/snapshots/{snapshot}", "httpMethod": "GET", - "description": "Returns the specified persistent disk snapshot resource.", + "description": "Returns the specified Snapshot resource.", "parameters": { "project": { "type": "string", @@ -8934,7 +11270,7 @@ }, "snapshot": { "type": "string", - "description": "Name of the persistent disk snapshot resource to return.", + "description": "Name of the Snapshot resource to return.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -8957,11 +11293,11 @@ "id": "compute.snapshots.list", "path": "{project}/global/snapshots", "httpMethod": "GET", - "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + "description": "Retrieves the list of Snapshot resources contained within the specified project.", "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -8975,7 +11311,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -9105,7 +11441,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -9119,7 +11455,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -9190,7 +11526,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -9204,7 +11540,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -9354,7 +11690,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -9368,7 +11704,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -9497,7 +11833,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -9511,7 +11847,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -9705,7 +12041,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -9719,7 +12055,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -9898,7 +12234,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -9912,7 +12248,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -10062,7 +12398,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -10076,7 +12412,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -10214,7 +12550,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -10228,7 +12564,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -10371,7 +12707,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -10385,7 +12721,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -10535,7 +12871,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -10549,7 +12885,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -10588,11 +12924,11 @@ "id": "compute.zoneOperations.delete", "path": "{project}/zones/{zone}/operations/{operation}", "httpMethod": "DELETE", - "description": "Deletes the specified zone-specific operation resource.", + "description": "Deletes the specified zone-specific Operations resource.", "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to delete.", + "description": "Name of the Operations resource to delete.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -10626,11 +12962,11 @@ "id": "compute.zoneOperations.get", "path": "{project}/zones/{zone}/operations/{operation}", "httpMethod": "GET", - "description": "Retrieves the specified zone-specific operation resource.", + "description": "Retrieves the specified zone-specific Operations resource.", "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to return.", + "description": "Name of the Operations resource to return.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -10668,11 +13004,11 @@ "id": "compute.zoneOperations.list", "path": "{project}/zones/{zone}/operations", "httpMethod": "GET", - "description": "Retrieves the list of operation resources contained within the specified zone.", + "description": "Retrieves the list of Operation resources contained within the specified zone.", "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -10686,7 +13022,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -10763,7 +13099,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -10777,7 +13113,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { diff --git a/etc/api/computeaccounts/alpha/computeaccounts-api.json b/etc/api/computeaccounts/alpha/computeaccounts-api.json index ce05d14f64..6d63be4472 100644 --- a/etc/api/computeaccounts/alpha/computeaccounts-api.json +++ b/etc/api/computeaccounts/alpha/computeaccounts-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/_MU5PPcJ1QQhdPzgwNErr00pIY8\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/E7cd_p6Q6F5Fnwd8jt7TC5Xxeg8\"", "discoveryVersion": "v1", "id": "computeaccounts:alpha", "name": "computeaccounts", "canonicalName": "Compute Accounts", "version": "alpha", - "revision": "20150320", + "revision": "20150622", "title": "Compute Accounts API", "description": "API for the Google Compute Accounts service.", "ownerDomain": "google.com", @@ -73,6 +73,12 @@ "https://www.googleapis.com/auth/cloud-platform": { "description": "View and manage your data across Google Cloud Platform services" }, + "https://www.googleapis.com/auth/cloud.useraccounts": { + "description": "Manage your Google Cloud User Accounts" + }, + "https://www.googleapis.com/auth/cloud.useraccounts.readonly": { + "description": "View your Google Cloud User Accounts" + }, "https://www.googleapis.com/auth/computeaccounts": { "description": "Manage your Google Compute Accounts" }, @@ -117,7 +123,7 @@ }, "kind": { "type": "string", - "description": "[Output Only] Type of the resource. Always computeaccounts#group for groups.", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#group for groups.", "default": "computeaccounts#group" }, "members": { @@ -130,12 +136,7 @@ "name": { "type": "string", "description": "Name of the resource; provided by the client when the resource is created.", - "pattern": "[a-z][-a-z0-9_]{0,31}", - "annotations": { - "required": [ - "computeaccounts.groups.insert" - ] - } + "pattern": "[a-z][-a-z0-9_]{0,31}" }, "selfLink": { "type": "string", @@ -160,7 +161,7 @@ }, "kind": { "type": "string", - "description": "[Output Only] Type of resource. Always computeaccounts#groupList for lists of groups.", + "description": "[Output Only] Type of resource. Always clouduseraccounts#groupList for lists of groups.", "default": "computeaccounts#groupList" }, "nextPageToken": { @@ -213,7 +214,7 @@ }, "kind": { "type": "string", - "description": "[Output Only] Type of the resource. Always computeaccounts#linuxAccountViews for Linux resources.", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#linuxAccountViews for Linux resources.", "default": "computeaccounts#linuxAccountViews" }, "userViews": { @@ -304,11 +305,11 @@ "Operation": { "id": "Operation", "type": "object", - "description": "An operation resource, used to manage asynchronous API requests.", + "description": "An Operation resource, used to manage asynchronous API requests.", "properties": { "clientOperationId": { "type": "string", - "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project." + "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project." }, "creationTimestamp": { "type": "string", @@ -499,7 +500,7 @@ "OperationList": { "id": "OperationList", "type": "object", - "description": "Contains a list of operation resources.", + "description": "Contains a list of Operation resources.", "properties": { "id": { "type": "string", @@ -507,7 +508,7 @@ }, "items": { "type": "array", - "description": "[Output Only] The operation resources.", + "description": "[Output Only] The Operation resources.", "items": { "$ref": "Operation" } @@ -581,27 +582,17 @@ }, "kind": { "type": "string", - "description": "[Output Only] Type of the resource. Always computeaccounts#user for users.", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#user for users.", "default": "computeaccounts#user" }, "name": { "type": "string", "description": "Name of the resource; provided by the client when the resource is created.", - "pattern": "[a-z][-a-z0-9_]{0,31}", - "annotations": { - "required": [ - "computeaccounts.users.insert" - ] - } + "pattern": "[a-z][-a-z0-9_]{0,31}" }, "owner": { "type": "string", - "description": "Email address of account's owner. This account will be validated to make sure it exists. The email can belong to any domain, but it must be tied to a Google account.", - "annotations": { - "required": [ - "computeaccounts.users.insert" - ] - } + "description": "Email address of account's owner. This account will be validated to make sure it exists. The email can belong to any domain, but it must be tied to a Google account." }, "publicKeys": { "type": "array", @@ -633,7 +624,7 @@ }, "kind": { "type": "string", - "description": "[Output Only] Type of resource. Always computeaccounts#userList for lists of users.", + "description": "[Output Only] Type of resource. Always clouduseraccounts#userList for lists of users.", "default": "computeaccounts#userList" }, "nextPageToken": { @@ -658,7 +649,7 @@ "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to delete.", + "description": "Name of the Operations resource to delete.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -677,6 +668,7 @@ ], "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", "https://www.googleapis.com/auth/computeaccounts" ] }, @@ -688,7 +680,7 @@ "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to return.", + "description": "Name of the Operations resource to return.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -710,6 +702,8 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly", "https://www.googleapis.com/auth/computeaccounts", "https://www.googleapis.com/auth/computeaccounts.readonly" ] @@ -722,7 +716,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -736,11 +730,12 @@ }, "orderBy": { "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", "location": "query" }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -759,6 +754,8 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly", "https://www.googleapis.com/auth/computeaccounts", "https://www.googleapis.com/auth/computeaccounts.readonly" ] @@ -800,6 +797,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", "https://www.googleapis.com/auth/computeaccounts" ] }, @@ -833,6 +831,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", "https://www.googleapis.com/auth/computeaccounts" ] }, @@ -866,6 +865,8 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly", "https://www.googleapis.com/auth/computeaccounts", "https://www.googleapis.com/auth/computeaccounts.readonly" ] @@ -895,6 +896,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", "https://www.googleapis.com/auth/computeaccounts" ] }, @@ -906,7 +908,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -920,11 +922,12 @@ }, "orderBy": { "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", "location": "query" }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -943,6 +946,8 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly", "https://www.googleapis.com/auth/computeaccounts", "https://www.googleapis.com/auth/computeaccounts.readonly" ] @@ -980,6 +985,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", "https://www.googleapis.com/auth/computeaccounts" ] } @@ -1032,6 +1038,8 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly", "https://www.googleapis.com/auth/computeaccounts", "https://www.googleapis.com/auth/computeaccounts.readonly" ] @@ -1044,7 +1052,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "instance": { @@ -1064,11 +1072,12 @@ }, "orderBy": { "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", "location": "query" }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -1102,6 +1111,8 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly", "https://www.googleapis.com/auth/computeaccounts", "https://www.googleapis.com/auth/computeaccounts.readonly" ] @@ -1143,6 +1154,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", "https://www.googleapis.com/auth/computeaccounts" ] }, @@ -1176,6 +1188,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", "https://www.googleapis.com/auth/computeaccounts" ] }, @@ -1209,6 +1222,8 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly", "https://www.googleapis.com/auth/computeaccounts", "https://www.googleapis.com/auth/computeaccounts.readonly" ] @@ -1238,6 +1253,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", "https://www.googleapis.com/auth/computeaccounts" ] }, @@ -1249,7 +1265,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -1263,11 +1279,12 @@ }, "orderBy": { "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", "location": "query" }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -1286,6 +1303,8 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly", "https://www.googleapis.com/auth/computeaccounts", "https://www.googleapis.com/auth/computeaccounts.readonly" ] @@ -1328,6 +1347,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", "https://www.googleapis.com/auth/computeaccounts" ] } diff --git a/etc/api/container/v1beta1/container-api.json b/etc/api/container/v1beta1/container-api.json index 0b7a20be3b..eea1ccbec0 100644 --- a/etc/api/container/v1beta1/container-api.json +++ b/etc/api/container/v1beta1/container-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/OAfpRt1IaExVFs9TE2m103dNYns\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/qwJnkUMoGYLzu0cB6f0uamqbj3k\"", "discoveryVersion": "v1", "id": "container:v1beta1", "name": "container", "version": "v1beta1", - "revision": "20150617", + "revision": "20150713", "title": "Google Container Engine API", "description": "The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology.", "ownerDomain": "google.com", diff --git a/etc/api/content/v2/content-api.json b/etc/api/content/v2/content-api.json index 7d5144256a..cd251d91b7 100644 --- a/etc/api/content/v2/content-api.json +++ b/etc/api/content/v2/content-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/RsxRME9Gu_f17mSFUnwX4Br4j90\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ZkR-AOQeuSbCQ7gjAz0_-RpvTqg\"", "discoveryVersion": "v1", "id": "content:v2", "name": "content", "canonicalName": "Shopping Content", "version": "v2", - "revision": "20150528", + "revision": "20150710", "title": "Content API for Shopping", "description": "Manage product items, inventory, and Merchant Center accounts for Google Shopping.", "ownerDomain": "google.com", @@ -2703,6 +2703,13 @@ "path": "accounts/batch", "httpMethod": "POST", "description": "Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request.", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + } + }, "request": { "$ref": "AccountsCustomBatchRequest" }, @@ -2726,6 +2733,11 @@ "format": "uint64", "location": "path" }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, "merchantId": { "type": "string", "description": "The ID of the managing account.", @@ -2780,6 +2792,11 @@ "httpMethod": "POST", "description": "Creates a Merchant Center sub-account.", "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, "merchantId": { "type": "string", "description": "The ID of the managing account.", @@ -2849,6 +2866,11 @@ "format": "uint64", "location": "path" }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, "merchantId": { "type": "string", "description": "The ID of the managing account.", @@ -2884,6 +2906,11 @@ "format": "uint64", "location": "path" }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, "merchantId": { "type": "string", "description": "The ID of the managing account.", @@ -3345,6 +3372,13 @@ "id": "content.datafeeds.custombatch", "path": "datafeeds/batch", "httpMethod": "POST", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + } + }, "request": { "$ref": "DatafeedsCustomBatchRequest" }, @@ -3367,6 +3401,11 @@ "format": "uint64", "location": "path" }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, "merchantId": { "type": "string", "required": true, @@ -3418,6 +3457,11 @@ "httpMethod": "POST", "description": "Registers a datafeed with your Merchant Center account.", "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, "merchantId": { "type": "string", "required": true, @@ -3485,6 +3529,11 @@ "format": "uint64", "location": "path" }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, "merchantId": { "type": "string", "required": true, @@ -3518,6 +3567,11 @@ "format": "uint64", "location": "path" }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, "merchantId": { "type": "string", "required": true, @@ -3631,6 +3685,13 @@ "path": "inventory/batch", "httpMethod": "POST", "description": "Updates price and availability for multiple products or stores in a single request.", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + } + }, "request": { "$ref": "InventoryCustomBatchRequest" }, @@ -3647,6 +3708,11 @@ "httpMethod": "POST", "description": "Updates price and availability of a product in your Merchant Center account.", "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, "merchantId": { "type": "string", "description": "The ID of the managing account.", diff --git a/etc/api/dataflow/v1b3/dataflow-api.json b/etc/api/dataflow/v1b3/dataflow-api.json index 02a2d03dea..eaf0b6d684 100644 --- a/etc/api/dataflow/v1b3/dataflow-api.json +++ b/etc/api/dataflow/v1b3/dataflow-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/0aH3PsMrpC4Dqa5K4gjLDjAQxF8\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/zns4Y3D5E2S2gwCEbkUlMZNgyY0\"", "discoveryVersion": "v1", "id": "dataflow:v1b3", "name": "dataflow", "version": "v1b3", - "revision": "20150303", + "revision": "20150322", "title": "Google Dataflow API", "description": "Google Dataflow API.", "ownerDomain": "google.com", @@ -142,6 +142,21 @@ "items": { "$ref": "StreamLocation" } + }, + "systemStageName": { + "type": "string" + }, + "userStageName": { + "type": "string" + } + } + }, + "CustomSourceLocation": { + "id": "CustomSourceLocation", + "type": "object", + "properties": { + "stateful": { + "type": "boolean" } } }, @@ -228,6 +243,12 @@ "type": "string" } }, + "internalExperiments": { + "type": "object", + "additionalProperties": { + "type": "any" + } + }, "sdkPipelineOptions": { "type": "object", "additionalProperties": { @@ -320,7 +341,8 @@ "JOB_STATE_FAILED", "JOB_STATE_RUNNING", "JOB_STATE_STOPPED", - "JOB_STATE_UNKNOWN" + "JOB_STATE_UNKNOWN", + "JOB_STATE_UPDATED" ], "enumDescriptions": [ "", @@ -328,6 +350,7 @@ "", "", "", + "", "" ] }, @@ -352,6 +375,9 @@ "replaceJobId": { "type": "string" }, + "replacedByJobId": { + "type": "string" + }, "requestedState": { "type": "string", "enum": [ @@ -360,7 +386,8 @@ "JOB_STATE_FAILED", "JOB_STATE_RUNNING", "JOB_STATE_STOPPED", - "JOB_STATE_UNKNOWN" + "JOB_STATE_UNKNOWN", + "JOB_STATE_UPDATED" ], "enumDescriptions": [ "", @@ -368,6 +395,7 @@ "", "", "", + "", "" ] }, @@ -1177,6 +1205,9 @@ "id": "StreamLocation", "type": "object", "properties": { + "customSourceLocation": { + "$ref": "CustomSourceLocation" + }, "pubsubLocation": { "$ref": "PubsubLocation" }, @@ -1350,6 +1381,12 @@ "items": { "$ref": "DataDiskAssignment" } + }, + "userStageToComputationNameMap": { + "type": "object", + "additionalProperties": { + "type": "string" + } } } }, diff --git a/etc/api/deploymentmanager/v2beta1/deploymentmanager-api.json b/etc/api/deploymentmanager/v2beta1/deploymentmanager-api.json index dfb2303bc2..b8838b4490 100644 --- a/etc/api/deploymentmanager/v2beta1/deploymentmanager-api.json +++ b/etc/api/deploymentmanager/v2beta1/deploymentmanager-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/zdpw3TZ9gd3rzuoO0gRqQ93MGhU\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/s4z2eJyMDiFWurSMIIUJE60QEOE\"", "discoveryVersion": "v1", "id": "deploymentmanager:v2beta1", "name": "deploymentmanager", "version": "v2beta1", - "revision": "20150616", + "revision": "20150715", "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.", "ownerDomain": "google.com", diff --git a/etc/api/deploymentmanager/v2beta2/deploymentmanager-api.json b/etc/api/deploymentmanager/v2beta2/deploymentmanager-api.json index 6f0e11a3d0..b4806342f8 100644 --- a/etc/api/deploymentmanager/v2beta2/deploymentmanager-api.json +++ b/etc/api/deploymentmanager/v2beta2/deploymentmanager-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/vTct0YRTxHgCzwTq1Z7USX--R9M\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/7OGyLzBmnM10uDn_nCHmZOUgRH8\"", "discoveryVersion": "v1", "id": "deploymentmanager:v2beta2", "name": "deploymentmanager", "canonicalName": "Deployment Manager", "version": "v2beta2", - "revision": "20150616", + "revision": "20150715", "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.", "ownerDomain": "google.com", @@ -94,7 +94,7 @@ }, "fingerprint": { "type": "string", - "description": "Specifies a fingerprint for update() requests. A fingerprint is a randomly generated value that must be provided in update() requests to perform optimistic locking. This ensures optimistic concurrency so that only one update can be performed at a time.\n\nThe fingerprint is initially generated by Deployment Manager and changes after every request to modify data. To get the latest fingerprint value, perform a get() request to a deployment.", + "description": "Specifies a fingerprint for update() requests. A fingerprint is a randomly generated value that must be provided in update() requests to perform optimistic locking. This ensures optimistic concurrency so that only one update can be performed at a time. The fingerprint is initially generated by Deployment Manager and changes after every request to modify data. To get the latest fingerprint value, perform a get() request to a deployment.", "format": "byte" }, "id": { @@ -116,7 +116,7 @@ }, "name": { "type": "string", - "description": "The name of the deployment, which must be unique within the project." + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash." }, "state": { "type": "string", @@ -251,11 +251,11 @@ "Operation": { "id": "Operation", "type": "object", - "description": "An operation resource, used to manage asynchronous API requests.", + "description": "An Operation resource, used to manage asynchronous API requests.", "properties": { "clientOperationId": { "type": "string", - "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project." + "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project." }, "creationTimestamp": { "type": "string", @@ -451,7 +451,7 @@ }, "type": { "type": "string", - "description": "[Output Only] The type of the resource, for example ?compute.v1.instance?, or ?replicaPools.v1beta2.instanceGroupManager?" + "description": "[Output Only] The type of the resource, for example compute.v1.instance, or replicaPools.v1beta2.instanceGroupManager." }, "update": { "$ref": "ResourceUpdate", @@ -673,7 +673,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -687,7 +687,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -927,7 +927,7 @@ }, "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -941,7 +941,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -1010,7 +1010,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -1024,7 +1024,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -1107,7 +1107,7 @@ }, "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -1121,7 +1121,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -1157,7 +1157,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:\nFIELD_NAME COMPARISON_STRING LITERAL_STRING\n \n- FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. \n- COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). \n- LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource:\nfilter=name ne example-instance\nThe above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes.", "location": "query" }, "maxResults": { @@ -1171,7 +1171,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { diff --git a/etc/api/discovery/v1/discovery-api.json b/etc/api/discovery/v1/discovery-api.json index 352ee400e7..ac553fc09c 100644 --- a/etc/api/discovery/v1/discovery-api.json +++ b/etc/api/discovery/v1/discovery-api.json @@ -1,6 +1,6 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/rJ-Wlqqs_yJDjtCFAIylPtmqXPY\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/jn2m36Cyj5Ei-KQXTI8Znl-wUic\"", "discoveryVersion": "v1", "id": "discovery:v1", "name": "discovery", @@ -344,6 +344,10 @@ "description": "The ETag for this response.", "readOnly": true }, + "exponentialBackoffDefault": { + "type": "boolean", + "description": "Enable exponential backoff for suitable methods in the generated clients." + }, "features": { "type": "array", "description": "A list of supported features for this API.", diff --git a/etc/api/dns/v1/dns-api.json b/etc/api/dns/v1/dns-api.json index 3789633af7..8748015acb 100644 --- a/etc/api/dns/v1/dns-api.json +++ b/etc/api/dns/v1/dns-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/CZ8yv2Lu-gQSA--NRFSPzzXCW7A\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/-U4jrXk6-vTBoDv0IALjnOwY9tw\"", "discoveryVersion": "v1", "id": "dns:v1", "name": "dns", "version": "v1", - "revision": "20150218", + "revision": "20150624", "title": "Google Cloud DNS API", "description": "The Google Cloud DNS API provides services for configuring and serving authoritative DNS records.", "ownerDomain": "google.com", @@ -572,6 +572,11 @@ "httpMethod": "GET", "description": "Enumerate ManagedZones that have been created but not yet deleted.", "parameters": { + "dnsName": { + "type": "string", + "description": "Restricts the list to return only zones with this domain name.", + "location": "query" + }, "maxResults": { "type": "integer", "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", diff --git a/etc/api/dns/v1beta1/dns-api.json b/etc/api/dns/v1beta1/dns-api.json index c2495cb64e..6e95468388 100644 --- a/etc/api/dns/v1beta1/dns-api.json +++ b/etc/api/dns/v1beta1/dns-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/oh0OKkMoXiShh-fNWjMyGYxRkos\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/oeG7uB52wsm8PPE9oV2doNReuXE\"", "discoveryVersion": "v1", "id": "dns:v1beta1", "name": "dns", "version": "v1beta1", - "revision": "20150218", + "revision": "20150624", "title": "Google Cloud DNS API", "description": "The Google Cloud DNS API provides services for configuring and serving authoritative DNS records.", "ownerDomain": "google.com", @@ -564,6 +564,11 @@ "httpMethod": "GET", "description": "Enumerate ManagedZones that have been created but not yet deleted.", "parameters": { + "dnsName": { + "type": "string", + "description": "Restricts the list to return only zones with this domain name.", + "location": "query" + }, "maxResults": { "type": "integer", "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", diff --git a/etc/api/doubleclicksearch/v2/doubleclicksearch-api.json b/etc/api/doubleclicksearch/v2/doubleclicksearch-api.json index 4c30c31cbe..e6e7a0a15c 100644 --- a/etc/api/doubleclicksearch/v2/doubleclicksearch-api.json +++ b/etc/api/doubleclicksearch/v2/doubleclicksearch-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ve8tEpbsG_IxtYaZBLsdJxUCrVI\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/X7AOv0-dwXq5VhzBANwBS6xU0aQ\"", "discoveryVersion": "v1", "id": "doubleclicksearch:v2", "name": "doubleclicksearch", "version": "v2", - "revision": "20150526", + "revision": "20150708", "title": "DoubleClick Search API", "description": "Report and modify your advertising data in DoubleClick Search (for example, campaigns, ad groups, keywords, and conversions).", "ownerDomain": "google.com", diff --git a/etc/api/drive/v1/drive-api.json b/etc/api/drive/v1/drive-api.json index a935c2dedb..f45ac88130 100644 --- a/etc/api/drive/v1/drive-api.json +++ b/etc/api/drive/v1/drive-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/rHeHaCJcqlwUUgfESgXN1mNQacA\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/kcCVDPs-5PNjr6BKMPQRpOOuEkc\"", "discoveryVersion": "v1", "id": "drive:v1", "name": "drive", "version": "v1", - "revision": "20150305", + "revision": "20150709", "title": "Drive API", "description": "The API to interact with Drive.", "ownerDomain": "google.com", @@ -91,8 +91,7 @@ "description": "A short description of the file" }, "downloadUrl": { - "type": "string", - "description": "Short term download URL for the file. This will only be populated on files with content stored in Drive." + "type": "string" }, "etag": { "type": "string", diff --git a/etc/api/drive/v2/drive-api.json b/etc/api/drive/v2/drive-api.json index 7a7df93cc5..8237ffec4d 100644 --- a/etc/api/drive/v2/drive-api.json +++ b/etc/api/drive/v2/drive-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/KEeW0PsH1Koyy8hFKaOTlOvpjfI\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/q8uch3ImrfylJzc7hmtPqukUei0\"", "discoveryVersion": "v1", "id": "drive:v2", "name": "drive", "version": "v2", - "revision": "20150305", + "revision": "20150709", "title": "Drive API", "description": "The API to interact with Drive.", "ownerDomain": "google.com", @@ -891,6 +891,10 @@ "type": "boolean", "description": "Whether this file is in the Application Data folder." }, + "canComment": { + "type": "boolean", + "description": "Whether the current user can comment on the file." + }, "copyable": { "type": "boolean", "description": "Whether the file can be copied by the current user." @@ -909,8 +913,7 @@ "description": "A short description of the file." }, "downloadUrl": { - "type": "string", - "description": "Short lived download URL for the file. This is only populated for files with content stored in Drive." + "type": "string" }, "editable": { "type": "boolean", @@ -926,7 +929,7 @@ }, "explicitlyTrashed": { "type": "boolean", - "description": "Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed." + "description": "Whether this file has been explicitly trashed, as opposed to recursively trashed." }, "exportLinks": { "type": "object", @@ -1166,6 +1169,10 @@ "type": "string", "description": "The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive." }, + "ownedByMe": { + "type": "boolean", + "description": "Whether the file is owned by the current user." + }, "ownerNames": { "type": "array", "description": "Name(s) of the owner(s) of this file.", @@ -1210,6 +1217,10 @@ "type": "string", "description": "A link back to this file." }, + "shareable": { + "type": "boolean", + "description": "Whether the file's sharing settings can be modified by the current user." + }, "shared": { "type": "boolean", "description": "Whether the file has been shared." @@ -2713,6 +2724,27 @@ "required": true, "location": "path" }, + "modifiedDateBehavior": { + "type": "string", + "description": "How the modifiedDate field should be updated. This overrides setModifiedDate.", + "enum": [ + "fromBody", + "fromBodyIfNeeded", + "fromBodyOrNow", + "noChange", + "now", + "nowIfNeeded" + ], + "enumDescriptions": [ + "Set modifiedDate to the value provided in the body of the request. No change if no value was provided.", + "Set modifiedDate to the value provided in the body of the request depending on other contents of the update.", + "Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.", + "Maintain the previous value of modifiedDate.", + "Set modifiedDate to the current time.", + "Set modifiedDate to the current time depending on contents of the update." + ], + "location": "query" + }, "newRevision": { "type": "boolean", "description": "Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions.", @@ -2890,6 +2922,27 @@ "required": true, "location": "path" }, + "modifiedDateBehavior": { + "type": "string", + "description": "How the modifiedDate field should be updated. This overrides setModifiedDate.", + "enum": [ + "fromBody", + "fromBodyIfNeeded", + "fromBodyOrNow", + "noChange", + "now", + "nowIfNeeded" + ], + "enumDescriptions": [ + "Set modifiedDate to the value provided in the body of the request. No change if no value was provided.", + "Set modifiedDate to the value provided in the body of the request depending on other contents of the update.", + "Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.", + "Maintain the previous value of modifiedDate.", + "Set modifiedDate to the current time.", + "Set modifiedDate to the current time depending on contents of the update." + ], + "location": "query" + }, "newRevision": { "type": "boolean", "description": "Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions.", diff --git a/etc/api/fitness/v1/fitness-api.json b/etc/api/fitness/v1/fitness-api.json index cac97fa784..ea73c7a86d 100644 --- a/etc/api/fitness/v1/fitness-api.json +++ b/etc/api/fitness/v1/fitness-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ON1-o8QnfSjPgDpi2fa5Rxma0qA\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/HDPUkwKxWfeChsVb7MggQS7MZkw\"", "discoveryVersion": "v1", "id": "fitness:v1", "name": "fitness", "version": "v1", - "revision": "20150527", + "revision": "20150720", "title": "Fitness", "description": "Google Fit API", "ownerDomain": "google.com", @@ -97,26 +97,28 @@ "properties": { "activity": { "type": "integer", - "description": "available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT", + "description": "Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT", "format": "int32" }, "dataset": { "type": "array", - "description": "There will be one dataset per datatype/datasource", + "description": "There will be one dataset per AggregateBy in the request.", "items": { "$ref": "Dataset" } }, "endTimeMillis": { "type": "string", + "description": "The end time for the aggregated data, in milliseconds since epoch, inclusive.", "format": "int64" }, "session": { "$ref": "Session", - "description": "available for Bucket.Type.SESSION" + "description": "Available for Bucket.Type.SESSION" }, "startTimeMillis": { "type": "string", + "description": "The start time for the aggregated data, in milliseconds since epoch, inclusive.", "format": "int64" }, "type": { @@ -142,19 +144,15 @@ "AggregateBy": { "id": "AggregateBy", "type": "object", + "description": "The specification of which data to aggregate.", "properties": { "dataSourceId": { - "type": "string" + "type": "string", + "description": "A data source ID to aggregate. Mutually exclusive of dataTypeName. Only data from the specified data source ID will be included in the aggregation. The dataset in the response will have the same data source ID." }, "dataTypeName": { "type": "string", - "description": "by dataype or by datasource" - }, - "outputDataSourceId": { - "type": "string" - }, - "outputDataTypeName": { - "type": "string" + "description": "The data type to aggregate. All data sources providing this data type will contribute data to the aggregation. The response will contain a single dataset for this data type name. The dataset will have a data source ID of derived:com.google.:com.google.android.gms:aggregated" } } }, @@ -164,31 +162,51 @@ "properties": { "aggregateBy": { "type": "array", + "description": "The specification of data to be aggregated. At least one aggregateBy spec must be provided. All data that is specified will be aggregated using the same bucketing criteria. There will be one dataset in the response for every aggregateBy spec.", "items": { "$ref": "AggregateBy" + }, + "annotations": { + "required": [ + "fitness.users.dataset.aggregate" + ] } }, "bucketByActivitySegment": { - "$ref": "BucketByActivity" + "$ref": "BucketByActivity", + "description": "Specifies that data be aggregated each activity segment recored for a user. Similar to bucketByActivitySegment, but bucketing is done for each activity segment rather than all segments of the same type. Mutually exclusive of other bucketing specifications." }, "bucketByActivityType": { - "$ref": "BucketByActivity" + "$ref": "BucketByActivity", + "description": "Specifies that data be aggregated by the type of activity being performed when the data was recorded. All data that was recorded during a certain activity type (for the given time range) will be aggregated into the same bucket. Data that was recorded while the user was not active will not be included in the response. Mutually exclusive of other bucketing specifications." }, "bucketBySession": { - "$ref": "BucketBySession" + "$ref": "BucketBySession", + "description": "Specifies that data be aggregated by user sessions. Data that does not fall within the time range of a session will not be included in the response. Mutually exclusive of other bucketing specifications." }, "bucketByTime": { "$ref": "BucketByTime", - "description": "apparently oneof is not supported by reduced_nano_proto" + "description": "Specifies that data be aggregated by a single time interval. Mutually exclusive of other bucketing specifications." }, "endTimeMillis": { "type": "string", - "format": "int64" + "description": "The end of a window of time. Data that intersects with this time window will be aggregated. The time is in milliseconds since epoch, inclusive.", + "format": "int64", + "annotations": { + "required": [ + "fitness.users.dataset.aggregate" + ] + } }, "startTimeMillis": { "type": "string", - "description": "required time range", - "format": "int64" + "description": "The start of a window of time. Data that intersects with this time window will be aggregated. The time is in milliseconds since epoch, inclusive.", + "format": "int64", + "annotations": { + "required": [ + "fitness.users.dataset.aggregate" + ] + } } } }, @@ -198,6 +216,7 @@ "properties": { "bucket": { "type": "array", + "description": "A list of buckets containing the aggregated data.", "items": { "$ref": "AggregateBucket" } @@ -240,11 +259,11 @@ "properties": { "activityDataSourceId": { "type": "string", - "description": "default activity stream will be used if not specified" + "description": "The default activity stream will be used if a specific activityDataSourceId is not specified." }, "minDurationMillis": { "type": "string", - "description": "Only activity segments of duration longer than this is used", + "description": "Specifies that only activity segments of duration longer than minDurationMillis are considered and used as a container for aggregated data.", "format": "int64" } } @@ -255,7 +274,7 @@ "properties": { "minDurationMillis": { "type": "string", - "description": "Only sessions of duration longer than this is used", + "description": "Specifies that only sessions of duration longer than minDurationMillis are considered and used as a container for aggregated data.", "format": "int64" } } @@ -266,6 +285,7 @@ "properties": { "durationMillis": { "type": "string", + "description": "Specifies that result buckets aggregate data by exactly durationMillis time frames. Time frames that contain no data will be included in the response with an empty dataset.", "format": "int64" } } @@ -647,6 +667,18 @@ } } }, + "MapValue": { + "id": "MapValue", + "type": "object", + "description": "Holder object for the value of an entry in a map field of a data point.\n\nA map value supports a subset of the formats that the regular Value supports.", + "properties": { + "fpVal": { + "type": "number", + "description": "Floating point value.", + "format": "double" + } + } + }, "Session": { "id": "Session", "type": "object", @@ -732,13 +764,36 @@ "properties": { "fpVal": { "type": "number", - "description": "Floating point value. When this is set, intVal must not be set.", + "description": "Floating point value. When this is set, other values must not be set.", "format": "double" }, "intVal": { "type": "integer", - "description": "Integer value. When this is set, fpVal must not be set.", + "description": "Integer value. When this is set, other values must not be set.", "format": "int32" + }, + "mapVal": { + "type": "array", + "description": "Map value. The valid key space and units for the corresponding value of each entry should be documented as part of the data type definition. Keys should be kept small whenever possible. Data streams with large keys and high data frequency may be down sampled.", + "items": { + "$ref": "ValueMapValEntry" + } + }, + "stringVal": { + "type": "string", + "description": "String value. When this is set, other values must not be set. Strings should be kept small whenever possible. Data streams with large string values and high data frequency may be down sampled." + } + } + }, + "ValueMapValEntry": { + "id": "ValueMapValEntry", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "$ref": "MapValue" } } } @@ -1110,9 +1165,11 @@ "id": "fitness.users.dataset.aggregate", "path": "{userId}/dataset:aggregate", "httpMethod": "POST", + "description": "Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggreated into exactly one bucket type per request.", "parameters": { "userId": { "type": "string", + "description": "Aggregate data for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", "required": true, "location": "path" } @@ -1125,7 +1182,12 @@ }, "response": { "$ref": "AggregateResponse" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.write", + "https://www.googleapis.com/auth/fitness.body.write", + "https://www.googleapis.com/auth/fitness.location.write" + ] } } }, diff --git a/etc/api/freebase/v1-sandbox/freebase-api.json b/etc/api/freebase/v1-sandbox/freebase-api.json index 615a47c91b..60989b0052 100644 --- a/etc/api/freebase/v1-sandbox/freebase-api.json +++ b/etc/api/freebase/v1-sandbox/freebase-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/QzWcCvAk2iPx6h55AprID4FQaKk\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/1uDhJzUzzQ0xFe9pZzLRKR2hVps\"", "discoveryVersion": "v1", "id": "freebase:v1-sandbox", "name": "freebase", "version": "v1-sandbox", - "revision": "20150330", + "revision": "20150715", "title": "Freebase Search", "description": "Find Freebase entities using textual queries and other constraints.", "ownerDomain": "google.com", diff --git a/etc/api/freebase/v1/freebase-api.json b/etc/api/freebase/v1/freebase-api.json index 98f9acc5bf..3020ade2aa 100644 --- a/etc/api/freebase/v1/freebase-api.json +++ b/etc/api/freebase/v1/freebase-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/tv8vDjrZWf-puRKfT3bKfsGPp8o\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/fu62NCNoN0rRqR4S4_Yco_vuY_4\"", "discoveryVersion": "v1", "id": "freebase:v1", "name": "freebase", "version": "v1", - "revision": "20150330", + "revision": "20150715", "title": "Freebase Search", "description": "Find Freebase entities using textual queries and other constraints.", "ownerDomain": "google.com", diff --git a/etc/api/freebase/v1sandbox/freebase-api.json b/etc/api/freebase/v1sandbox/freebase-api.json index 716fc47bc4..09255f2f24 100644 --- a/etc/api/freebase/v1sandbox/freebase-api.json +++ b/etc/api/freebase/v1sandbox/freebase-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/pIrI8aSY3RlGBQ9YIIjJFeqVKF0\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/eOsxHqbqBq4G1nA6of-PTFhvOp8\"", "discoveryVersion": "v1", "id": "freebase:v1sandbox", "name": "freebase", "version": "v1sandbox", - "revision": "20150330", + "revision": "20150715", "title": "Freebase Search", "description": "Find Freebase entities using textual queries and other constraints.", "ownerDomain": "google.com", diff --git a/etc/api/fusiontables/v1/fusiontables-api.json b/etc/api/fusiontables/v1/fusiontables-api.json index 636ebf1e8c..440a1ba06c 100644 --- a/etc/api/fusiontables/v1/fusiontables-api.json +++ b/etc/api/fusiontables/v1/fusiontables-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/4HCFw9IZNfeLuwpeJU6_2IK7soQ\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/p6GA7xzHW6CCawyWvPtjDNDmhiU\"", "discoveryVersion": "v1", "id": "fusiontables:v1", "name": "fusiontables", "version": "v1", - "revision": "20150326", + "revision": "20150618", "title": "Fusion Tables API", "description": "API for working with Fusion Tables data.", "ownerDomain": "google.com", diff --git a/etc/api/fusiontables/v2/fusiontables-api.json b/etc/api/fusiontables/v2/fusiontables-api.json index a731939c24..bda5e37d7c 100644 --- a/etc/api/fusiontables/v2/fusiontables-api.json +++ b/etc/api/fusiontables/v2/fusiontables-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/dI_tOjeJOWF2ORhLQyVd-42H-68\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/KKbMdmXY9h4Xu-h2_z-RyvFgeY0\"", "discoveryVersion": "v1", "id": "fusiontables:v2", "name": "fusiontables", "version": "v2", - "revision": "20150326", + "revision": "20150618", "title": "Fusion Tables API", "description": "API for working with Fusion Tables data.", "ownerDomain": "google.com", diff --git a/etc/api/games/v1/games-api.json b/etc/api/games/v1/games-api.json index e8871f6d5e..60edf317c4 100644 --- a/etc/api/games/v1/games-api.json +++ b/etc/api/games/v1/games-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/mrz_UffhvFtAEj5vHgLDFJrlEO4\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/kMJ5WSJLlpaiYVrD6C0XoIYYZuQ\"", "discoveryVersion": "v1", "id": "games:v1", "name": "games", "canonicalName": "Games", "version": "v1", - "revision": "20150601", + "revision": "20150717", "title": "Google Play Game Services API", "description": "The API for Google Play Game Services.", "ownerDomain": "google.com", @@ -3558,7 +3558,7 @@ "description": "The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults.", "format": "int32", "minimum": "1", - "maximum": "15", + "maximum": "50", "location": "query" }, "pageToken": { diff --git a/etc/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json b/etc/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json index 13f99d9bdb..9c128d0fb8 100644 --- a/etc/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json +++ b/etc/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/x7h1W7MHWqOKw-Ox_tyfV04C-F0\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/sMcZMsBUEjDYKHCXGpDphmDRHRw\"", "discoveryVersion": "v1", "id": "gamesConfiguration:v1configuration", "name": "gamesConfiguration", "canonicalName": "Games Configuration", "version": "v1configuration", - "revision": "20150601", + "revision": "20150717", "title": "Google Play Game Services Publishing API", "description": "The Publishing API for Google Play Game Services.", "ownerDomain": "google.com", diff --git a/etc/api/gamesmanagement/v1management/gamesmanagement-api.json b/etc/api/gamesmanagement/v1management/gamesmanagement-api.json index 8e6daebaba..d7465d5073 100644 --- a/etc/api/gamesmanagement/v1management/gamesmanagement-api.json +++ b/etc/api/gamesmanagement/v1management/gamesmanagement-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/oC18PbFsOPKgTlxUwLIUeBOrwcY\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/wNuOjQAjwhPKEaAKl2_MUVwyufA\"", "discoveryVersion": "v1", "id": "gamesManagement:v1management", "name": "gamesManagement", "canonicalName": "Games Management", "version": "v1management", - "revision": "20150601", + "revision": "20150717", "title": "Google Play Game Services Management API", "description": "The Management API for Google Play Game Services.", "ownerDomain": "google.com", @@ -504,7 +504,7 @@ "description": "The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults.", "format": "int32", "minimum": "1", - "maximum": "15", + "maximum": "50", "location": "query" }, "pageToken": { diff --git a/etc/api/genomics/v1/genomics-api.json b/etc/api/genomics/v1/genomics-api.json index e6ad6a7477..e562f4d967 100644 --- a/etc/api/genomics/v1/genomics-api.json +++ b/etc/api/genomics/v1/genomics-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/78ZDw2UBdovyKdzpDDyo3AbROrQ\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/FV8wyJgOhzZ7rpR6g2FmI8jROkE\"", "discoveryVersion": "v1", "id": "genomics:v1", "name": "genomics", "version": "v1", - "revision": "20150615", + "revision": "20150716", "title": "Genomics API", "description": "An API to store, process, explore, and share DNA sequence reads, reference-based alignments, and variant calls.", "ownerDomain": "google.com", @@ -99,5 +99,2547 @@ ], "location": "query" } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/bigquery": { + "description": "View and manage your data in Google BigQuery" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/genomics": { + "description": "View and manage Genomics data" + }, + "https://www.googleapis.com/auth/genomics.readonly": { + "description": "View Genomics data" + } + } + } + }, + "schemas": { + "ListDatasetsResponse": { + "id": "ListDatasetsResponse", + "type": "object", + "description": "The dataset list response.", + "properties": { + "datasets": { + "type": "array", + "description": "The list of matching Datasets.", + "items": { + "$ref": "Dataset" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "Dataset": { + "id": "Dataset", + "type": "object", + "description": "A Dataset is a collection of genomic data.", + "properties": { + "id": { + "type": "string", + "description": "The server-generated dataset ID, unique across all datasets." + }, + "projectId": { + "type": "string", + "description": "The Google Developers Console project ID that this dataset belongs to." + }, + "name": { + "type": "string", + "description": "The dataset name." + }, + "createTime": { + "type": "string", + "description": "The time this dataset was created, in seconds from the epoch." + } + } + }, + "Empty": { + "id": "Empty", + "type": "object", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`." + }, + "UndeleteDatasetRequest": { + "id": "UndeleteDatasetRequest", + "type": "object" + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "This resource represents a long-running operation that is the result of a network API call.", + "properties": { + "name": { + "type": "string", + "description": "The server-assigned name, which is only unique within the same service that originally returns it. For example: `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw`" + }, + "metadata": { + "type": "object", + "description": "An [OperationMetadata][google.genomics.v1.OperationMetadata] object. This will always be returned with the [Operation][google.longrunning.Operation].", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + }, + "done": { + "type": "boolean", + "description": "If the value is `false`, it means the operation is still in progress. If true, the operation is completed and the `result` is available." + }, + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure." + }, + "response": { + "type": "object", + "description": "If importing [ReadGroupSets][google.genomics.v1.ReadGroupSet], an [ImportReadGroupSetsResponse][google.genomics.v1.ImportReadGroupSetsResponse] is returned. If importing [Variants][google.genomics.v1.Variant], an [ImportVariantsResponse][google.genomics.v1.ImportVariantsResponse] is returned. For exports, an empty response is returned.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + }, + "Status": { + "id": "Status", + "type": "object", + "description": "The `Status` defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). The error model is designed to be: - Simple to use and understand for most users. - Flexible enough to meet unexpected needs. # Overview The `Status` message contains 3 pieces of data: error code, error message, and error details. The error code should be an enum value of [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers *understand* and *resolve* the error. If a localized user-facing error message is needed, it can be sent in the error details or localized by the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package `google.rpc` which can be used for common error conditions. # Language mapping The `Status` message is the logical representation of the error model, but it is not necessarily the actual wire format. When the `Status` message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C. # Other uses The error model and the `Status` message can be used in a variety of environments - either with or without APIs - to provide consistent developer experience across different environments. Example uses of this error model include: - Partial errors. If a service needs to return partial errors to the client, it may embed the `Status` in the normal response to indicate the partial errors. - Workflow errors. A typical workflow has multiple steps. Each step may have a `Status` message for error reporting purpose. - Batch operations. If a client uses batch request and batch response, the `Status` message should be used directly inside batch response, one for each error sub-response. - Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the `Status` message. - Logging. If some API errors are stored in logs, the message `Status` could be used directly after any stripping needed for security/privacy reasons.", + "properties": { + "code": { + "type": "integer", + "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", + "format": "int32" + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." + }, + "details": { + "type": "array", + "description": "A list of messages that carry the error details. There will be a common set of message types for APIs to use.", + "items": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + } + }, + "ListOperationsResponse": { + "id": "ListOperationsResponse", + "type": "object", + "description": "The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].", + "properties": { + "operations": { + "type": "array", + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "Operation" + } + }, + "nextPageToken": { + "type": "string", + "description": "The standard List next-page token." + } + } + }, + "CancelOperationRequest": { + "id": "CancelOperationRequest", + "type": "object", + "description": "The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]." + }, + "ImportReadGroupSetsRequest": { + "id": "ImportReadGroupSetsRequest", + "type": "object", + "description": "The read group set import request.", + "properties": { + "datasetId": { + "type": "string", + "description": "Required. The ID of the dataset these read group sets will belong to. The caller must have WRITE permissions to this dataset." + }, + "referenceSetId": { + "type": "string", + "description": "The reference set to which the imported read group sets are aligned to, if any. The reference names of this reference set must be a superset of those found in the imported file headers. If no reference set id is provided, a best effort is made to associate with a matching reference set." + }, + "sourceUris": { + "type": "array", + "description": "A list of URIs pointing at BAM files in Google Cloud Storage.", + "items": { + "type": "string" + } + }, + "partitionStrategy": { + "type": "string", + "description": "The partition strategy describes how read groups are partitioned into read group sets.", + "enum": [ + "PARTITION_STRATEGY_UNSPECIFIED", + "PER_FILE_PER_SAMPLE", + "MERGE_ALL" + ] + } + } + }, + "ExportReadGroupSetRequest": { + "id": "ExportReadGroupSetRequest", + "type": "object", + "description": "The read group set export request.", + "properties": { + "projectId": { + "type": "string", + "description": "Required. The Google Developers Console project ID that owns this export." + }, + "exportUri": { + "type": "string", + "description": "Required. 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." + }, + "referenceNames": { + "type": "array", + "description": "The reference names to export. If this is not specified, all reference sequences, including unmapped reads, are exported. Use `*` to export only unmapped reads.", + "items": { + "type": "string" + } + } + } + }, + "SearchReadGroupSetsRequest": { + "id": "SearchReadGroupSetsRequest", + "type": "object", + "description": "The read group set search request.", + "properties": { + "datasetIds": { + "type": "array", + "description": "Restricts this query to read group sets within the given datasets. At least one ID must be provided.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "Only return read group sets for which a substring of the name matches this string." + }, + "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." + }, + "pageSize": { + "type": "integer", + "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" + } + } + }, + "SearchReadGroupSetsResponse": { + "id": "SearchReadGroupSetsResponse", + "type": "object", + "description": "The read group set search response.", + "properties": { + "readGroupSets": { + "type": "array", + "description": "The list of matching read group sets.", + "items": { + "$ref": "ReadGroupSet" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "ReadGroupSet": { + "id": "ReadGroupSet", + "type": "object", + "description": "A read group set is a logical collection of read groups, which are collections of reads produced by a sequencer. A read group set typically models reads corresponding to one sample, sequenced one way, and aligned one way. * A read group set belongs to one dataset. * A read group belongs to one read group set. * A read belongs to one read group.", + "properties": { + "id": { + "type": "string", + "description": "The server-generated read group set ID, unique for all read group sets." + }, + "datasetId": { + "type": "string", + "description": "The dataset ID." + }, + "referenceSetId": { + "type": "string", + "description": "The reference set the reads in this read group set are aligned to." + }, + "name": { + "type": "string", + "description": "The read group set name. By default this will be initialized to the sample name of the sequenced data contained in this set." + }, + "filename": { + "type": "string", + "description": "The filename of the original source file for this read group set, if any." + }, + "readGroups": { + "type": "array", + "description": "The read groups in this set. There are typically 1-10 read groups in a read group set.", + "items": { + "$ref": "ReadGroup" + } + }, + "info": { + "type": "object", + "description": "A map of additional read group set information.", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "ReadGroup": { + "id": "ReadGroup", + "type": "object", + "description": "A read group is all the data that's processed the same way by the sequencer.", + "properties": { + "id": { + "type": "string", + "description": "The server-generated read group ID, unique for all read groups. Note: This is different than the `@RG ID` field in the SAM spec. For that value, see the `name` field." + }, + "datasetId": { + "type": "string", + "description": "The ID of the dataset this read group belongs to." + }, + "name": { + "type": "string", + "description": "The read group name. This corresponds to the @RG ID field in the SAM spec." + }, + "description": { + "type": "string", + "description": "A free-form text description of this read group." + }, + "sampleId": { + "type": "string", + "description": "The sample this read group's data was generated from. Note: This is not an actual ID within this repository, but rather an identifier for a sample which may be meaningful to some external system." + }, + "experiment": { + "$ref": "Experiment", + "description": "The experiment used to generate this read group." + }, + "predictedInsertSize": { + "type": "integer", + "description": "The predicted insert size of this read group. The insert size is the length the sequenced DNA fragment from end-to-end, not including the adapters.", + "format": "int32" + }, + "programs": { + "type": "array", + "description": "The programs used to generate this read group. Programs are always identical for all read groups within a read group set. For this reason, only the first read group in a returned set will have this field populated.", + "items": { + "$ref": "Program" + } + }, + "referenceSetId": { + "type": "string", + "description": "The reference set the reads in this read group are aligned to. Required if there are any read alignments." + }, + "info": { + "type": "object", + "description": "A map of additional read group information. This must be of the form map (string key mapping to a list of string values).", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "Experiment": { + "id": "Experiment", + "type": "object", + "properties": { + "libraryId": { + "type": "string", + "description": "The library used as part of this experiment. Note: This is not an actual ID within this repository, but rather an identifier for a library which may be meaningful to some external system." + }, + "platformUnit": { + "type": "string", + "description": "The platform unit used as part of this experiment e.g. flowcell-barcode.lane for Illumina or slide for SOLiD. Corresponds to the @RG PU field in the SAM spec." + }, + "sequencingCenter": { + "type": "string", + "description": "The sequencing center used as part of this experiment." + }, + "instrumentModel": { + "type": "string", + "description": "The instrument model used as part of this experiment. This maps to sequencing technology in BAM." + } + } + }, + "Program": { + "id": "Program", + "type": "object", + "properties": { + "commandLine": { + "type": "string", + "description": "The command line used to run this program." + }, + "id": { + "type": "string", + "description": "The user specified locally unique ID of the program. Used along with `prevProgramId` to define an ordering between programs." + }, + "name": { + "type": "string", + "description": "The name of the program." + }, + "prevProgramId": { + "type": "string", + "description": "The ID of the program run before this one." + }, + "version": { + "type": "string", + "description": "The version of the program run." + } + } + }, + "ListCoverageBucketsResponse": { + "id": "ListCoverageBucketsResponse", + "type": "object", + "properties": { + "bucketWidth": { + "type": "string", + "description": "The length of each coverage bucket in base pairs. Note that buckets at the end of a reference sequence may be shorter. This value is omitted if the bucket width is infinity (the default behaviour, with no range or `targetBucketWidth`).", + "format": "int64" + }, + "coverageBuckets": { + "type": "array", + "description": "The coverage buckets. The list of buckets is sparse; a bucket with 0 overlapping reads is not returned. A bucket never crosses more than one reference sequence. Each bucket has width `bucketWidth`, unless its end is the end of the reference sequence.", + "items": { + "$ref": "CoverageBucket" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "CoverageBucket": { + "id": "CoverageBucket", + "type": "object", + "description": "A bucket over which read coverage has been precomputed. A bucket corresponds to a specific range of the reference sequence.", + "properties": { + "range": { + "$ref": "Range", + "description": "The genomic coordinate range spanned by this bucket." + }, + "meanCoverage": { + "type": "number", + "description": "The average number of reads which are aligned to each individual reference base in this bucket.", + "format": "float" + } + } + }, + "Range": { + "id": "Range", + "type": "object", + "description": "A 0-based half-open genomic coordinate range for search requests.", + "properties": { + "referenceName": { + "type": "string", + "description": "The reference sequence name, for example `chr1`, `1`, or `chrX`." + }, + "start": { + "type": "string", + "description": "The start position of the range on the reference, 0-based inclusive.", + "format": "int64" + }, + "end": { + "type": "string", + "description": "The end position of the range on the reference, 0-based exclusive.", + "format": "int64" + } + } + }, + "SearchReadsRequest": { + "id": "SearchReadsRequest", + "type": "object", + "description": "The read search request.", + "properties": { + "readGroupSetIds": { + "type": "array", + "description": "The IDs of the read groups sets within which to search for reads. All specified read group sets must be aligned against a common set of reference sequences; this defines the genomic coordinates for the query. Must specify one of `readGroupSetIds` or `readGroupIds`.", + "items": { + "type": "string" + } + }, + "readGroupIds": { + "type": "array", + "description": "The IDs of the read groups within which to search for reads. All specified read groups must belong to the same read group sets. Must specify one of `readGroupSetIds` or `readGroupIds`.", + "items": { + "type": "string" + } + }, + "referenceName": { + "type": "string", + "description": "The reference sequence name, for example `chr1`, `1`, or `chrX`. If set to *, only unmapped reads are returned." + }, + "start": { + "type": "string", + "description": "The start position of the range on the reference, 0-based inclusive. If specified, `referenceName` must also be specified.", + "format": "int64" + }, + "end": { + "type": "string", + "description": "The end position of the range on the reference, 0-based exclusive. If specified, `referenceName` must also be specified.", + "format": "int64" + }, + "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." + }, + "pageSize": { + "type": "integer", + "description": "Specifies number of results to return in a single page. If unspecified, it will default to 256. The maximum value is 2048.", + "format": "int32" + } + } + }, + "SearchReadsResponse": { + "id": "SearchReadsResponse", + "type": "object", + "description": "The read search response.", + "properties": { + "alignments": { + "type": "array", + "description": "The list of matching alignments sorted by mapped genomic coordinate, if any, ascending in position within the same reference. Unmapped reads, which have no position, are returned last and are further sorted in ascending lexicographic order by fragment name.", + "items": { + "$ref": "Read" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "Read": { + "id": "Read", + "type": "object", + "description": "A read alignment describes a linear alignment of a string of DNA to a [reference sequence][google.genomics.v1.Reference], in addition to metadata about the fragment (the molecule of DNA sequenced) and the read (the bases which were read by the sequencer). A read is equivalent to a line in a SAM file. A read belongs to exactly one read group and exactly one [read group set][google.genomics.v1.ReadGroupSet]. ### Generating a reference-aligned sequence string When interacting with mapped reads, it's often useful to produce a string representing the local alignment of the read to reference. The following pseudocode demonstrates one way of doing this: out = \"\" offset = 0 for c in read.alignment.cigar { switch c.operation { case \"ALIGNMENT_MATCH\", \"SEQUENCE_MATCH\", \"SEQUENCE_MISMATCH\": out += read.alignedSequence[offset:offset+c.operationLength] offset += c.operationLength break case \"CLIP_SOFT\", \"INSERT\": offset += c.operationLength break case \"PAD\": out += repeat(\"*\", c.operationLength) break case \"DELETE\": out += repeat(\"-\", c.operationLength) break case \"SKIP\": out += repeat(\" \", c.operationLength) break case \"CLIP_HARD\": break } } return out ### Converting to SAM's CIGAR string The following pseudocode generates a SAM CIGAR string from the `cigar` field. Note that this is a lossy conversion (`cigar.referenceSequence` is lost). cigarMap = { \"ALIGNMENT_MATCH\": \"M\", \"INSERT\": \"I\", \"DELETE\": \"D\", \"SKIP\": \"N\", \"CLIP_SOFT\": \"S\", \"CLIP_HARD\": \"H\", \"PAD\": \"P\", \"SEQUENCE_MATCH\": \"=\", \"SEQUENCE_MISMATCH\": \"X\", } cigarStr = \"\" for c in read.alignment.cigar { cigarStr += c.operationLength + cigarMap[c.operation] } return cigarStr", + "properties": { + "id": { + "type": "string", + "description": "The server-generated read ID, unique across all reads. This is different from the `fragmentName`." + }, + "readGroupId": { + "type": "string", + "description": "The ID of the read group this read belongs to. (Every read must belong to exactly one read group.)" + }, + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set this read belongs to. (Every read must belong to exactly one read group set.)" + }, + "fragmentName": { + "type": "string", + "description": "The fragment name. Equivalent to QNAME (query template name) in SAM." + }, + "properPlacement": { + "type": "boolean", + "description": "The orientation and the distance between reads from the fragment are consistent with the sequencing protocol (SAM flag 0x2)" + }, + "duplicateFragment": { + "type": "boolean", + "description": "The fragment is a PCR or optical duplicate (SAM flag 0x400)" + }, + "fragmentLength": { + "type": "integer", + "description": "The observed length of the fragment, equivalent to TLEN in SAM.", + "format": "int32" + }, + "readNumber": { + "type": "integer", + "description": "The read number in sequencing. 0-based and less than numberReads. This field replaces SAM flag 0x40 and 0x80.", + "format": "int32" + }, + "numberReads": { + "type": "integer", + "description": "The number of reads in the fragment (extension to SAM flag 0x1).", + "format": "int32" + }, + "failedVendorQualityChecks": { + "type": "boolean", + "description": "SAM flag 0x200" + }, + "alignment": { + "$ref": "LinearAlignment", + "description": "The linear alignment for this alignment record. This field will be null if the read is unmapped." + }, + "secondaryAlignment": { + "type": "boolean", + "description": "Whether this alignment is secondary. Equivalent to SAM flag 0x100. A secondary alignment represents an alternative to the primary alignment for this read. Aligners may return secondary alignments if a read can map ambiguously to multiple coordinates in the genome. By convention, each read has one and only one alignment where both `secondaryAlignment` and `supplementaryAlignment` are false." + }, + "supplementaryAlignment": { + "type": "boolean", + "description": "Whether this alignment is supplementary. Equivalent to SAM flag 0x800. Supplementary alignments are used in the representation of a chimeric alignment. In a chimeric alignment, a read is split into multiple linear alignments that map to different reference contigs. The first linear alignment in the read will be designated as the representative alignment; the remaining linear alignments will be designated as supplementary alignments. These alignments may have different mapping quality scores. In each linear alignment in a chimeric alignment, the read will be hard clipped. The `alignedSequence` and `alignedQuality` fields in the alignment record will only represent the bases for its respective linear alignment." + }, + "alignedSequence": { + "type": "string", + "description": "The bases of the read sequence contained in this alignment record, *without CIGAR operations applied*. `alignedSequence` and `alignedQuality` may be shorter than the full read sequence and quality. This will occur if the alignment is part of a chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR for this read will begin/end with a hard clip operator that will indicate the length of the excised sequence." + }, + "alignedQuality": { + "type": "array", + "description": "The quality of the read sequence contained in this alignment record. `alignedSequence` and `alignedQuality` may be shorter than the full read sequence and quality. This will occur if the alignment is part of a chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR for this read will begin/end with a hard clip operator that will indicate the length of the excised sequence.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "nextMatePosition": { + "$ref": "Position", + "description": "The mapping of the primary alignment of the `(readNumber+1)%numberReads` read in the fragment. It replaces mate position and mate strand in SAM." + }, + "info": { + "type": "object", + "description": "A map of additional read alignment information. This must be of the form map (string key mapping to a list of string values).", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "LinearAlignment": { + "id": "LinearAlignment", + "type": "object", + "description": "A linear alignment can be represented by one CIGAR string. Describes the mapped position and local alignment of the read to the reference.", + "properties": { + "position": { + "$ref": "Position", + "description": "The position of this alignment." + }, + "mappingQuality": { + "type": "integer", + "description": "The mapping quality of this alignment. Represents how likely the read maps to this position as opposed to other locations.", + "format": "int32" + }, + "cigar": { + "type": "array", + "description": "Represents the local alignment of this sequence (alignment matches, indels, etc) against the reference.", + "items": { + "$ref": "CigarUnit" + } + } + } + }, + "Position": { + "id": "Position", + "type": "object", + "description": "An abstraction for referring to a genomic position, in relation to some already known reference. For now, represents a genomic position as a reference name, a base number on that reference (0-based), and a determination of forward or reverse strand.", + "properties": { + "referenceName": { + "type": "string", + "description": "The name of the reference in whatever reference set is being used." + }, + "position": { + "type": "string", + "description": "The 0-based offset from the start of the forward strand for that reference.", + "format": "int64" + }, + "reverseStrand": { + "type": "boolean", + "description": "Whether this position is on the reverse strand, as opposed to the forward strand." + } + } + }, + "CigarUnit": { + "id": "CigarUnit", + "type": "object", + "description": "A single CIGAR operation.", + "properties": { + "operation": { + "type": "string", + "enum": [ + "OPERATION_UNSPECIFIED", + "ALIGNMENT_MATCH", + "INSERT", + "DELETE", + "SKIP", + "CLIP_SOFT", + "CLIP_HARD", + "PAD", + "SEQUENCE_MATCH", + "SEQUENCE_MISMATCH" + ] + }, + "operationLength": { + "type": "string", + "description": "The number of genomic bases that the operation runs for. Required.", + "format": "int64" + }, + "referenceSequence": { + "type": "string", + "description": "`referenceSequence` is only used at mismatches (`SEQUENCE_MISMATCH`) and deletions (`DELETE`). Filling this field replaces SAM's MD tag. If the relevant information is not available, this field is unset." + } + } + }, + "SearchReferenceSetsRequest": { + "id": "SearchReferenceSetsRequest", + "type": "object", + "properties": { + "md5checksums": { + "type": "array", + "description": "If present, return references for which the `md5checksum` matches. See `ReferenceSet.md5checksum` for details.", + "items": { + "type": "string" + } + }, + "accessions": { + "type": "array", + "description": "If present, return references for which the accession matches any of these strings. Best to give a version number, for example `GCF_000001405.26`. If only the main accession number is given then all records with that main accession will be returned, whichever version. Note that different versions will have different sequences.", + "items": { + "type": "string" + } + }, + "assemblyId": { + "type": "string", + "description": "If present, return reference sets for which a substring of their `assemblyId` matches this string (case insensitive)." + }, + "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." + }, + "pageSize": { + "type": "integer", + "description": "Specifies the maximum number of results to return in a single page.", + "format": "int32" + } + } + }, + "SearchReferenceSetsResponse": { + "id": "SearchReferenceSetsResponse", + "type": "object", + "properties": { + "referenceSets": { + "type": "array", + "description": "The matching references sets.", + "items": { + "$ref": "ReferenceSet" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "ReferenceSet": { + "id": "ReferenceSet", + "type": "object", + "description": "A reference set is a set of references which typically comprise a reference assembly for a species, such as `GRCh38` which is representative of the human genome. A reference set defines a common coordinate space for comparing reference-aligned experimental data. A reference set contains 1 or more references.", + "properties": { + "id": { + "type": "string", + "description": "The server-generated reference set ID, unique across all reference sets." + }, + "referenceIds": { + "type": "array", + "description": "The IDs of the reference objects that are part of this set. `Reference.md5checksum` must be unique within this set.", + "items": { + "type": "string" + } + }, + "md5checksum": { + "type": "string", + "description": "Order-independent MD5 checksum which identifies this reference set. The checksum is computed by sorting all lower case hexidecimal string `reference.md5checksum` (for all reference in this set) in ascending lexicographic order, concatenating, and taking the MD5 of that value. The resulting value is represented in lower case hexadecimal format." + }, + "ncbiTaxonId": { + "type": "integer", + "description": "ID from http://www.ncbi.nlm.nih.gov/taxonomy (e.g. 9606-\u003ehuman) indicating the species which this assembly is intended to model. Note that contained references may specify a different `ncbiTaxonId`, as assemblies may contain reference sequences which do not belong to the modeled species, e.g. EBV in a human reference genome.", + "format": "int32" + }, + "description": { + "type": "string", + "description": "Free text description of this reference set." + }, + "assemblyId": { + "type": "string", + "description": "Public id of this reference set, such as `GRCh37`." + }, + "sourceUri": { + "type": "string", + "description": "The URI from which the references were obtained." + }, + "sourceAccessions": { + "type": "array", + "description": "All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally with a version number, for example `NC_000001.11`.", + "items": { + "type": "string" + } + } + } + }, + "SearchReferencesRequest": { + "id": "SearchReferencesRequest", + "type": "object", + "properties": { + "md5checksums": { + "type": "array", + "description": "If present, return references for which the `md5checksum` matches. See `Reference.md5checksum` for construction details.", + "items": { + "type": "string" + } + }, + "accessions": { + "type": "array", + "description": "If present, return references for which the accession matches this string. Best to give a version number, for example `GCF_000001405.26`. If only the main accession number is given then all records with that main accession will be returned, whichever version. Note that different versions will have different sequences.", + "items": { + "type": "string" + } + }, + "referenceSetId": { + "type": "string", + "description": "If present, return only references which belong to this reference set." + }, + "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." + }, + "pageSize": { + "type": "integer", + "description": "Specifies the maximum number of results to return in a single page.", + "format": "int32" + } + } + }, + "SearchReferencesResponse": { + "id": "SearchReferencesResponse", + "type": "object", + "properties": { + "references": { + "type": "array", + "description": "The matching references.", + "items": { + "$ref": "Reference" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "Reference": { + "id": "Reference", + "type": "object", + "description": "A reference is a canonical assembled DNA sequence, intended to act as a reference coordinate space for other genomic annotations. A single reference might represent the human chromosome 1 or mitochandrial DNA, for instance. A reference belongs to one or more reference sets.", + "properties": { + "id": { + "type": "string", + "description": "The server-generated reference ID, unique across all references." + }, + "length": { + "type": "string", + "description": "The length of this reference's sequence.", + "format": "int64" + }, + "md5checksum": { + "type": "string", + "description": "MD5 of the upper-case sequence excluding all whitespace characters (this is equivalent to SQ:M5 in SAM). This value is represented in lower case hexadecimal format." + }, + "name": { + "type": "string", + "description": "The name of this reference, for example `22`." + }, + "sourceUri": { + "type": "string", + "description": "The URI from which the sequence was obtained. Specifies a FASTA format file/string with one name, sequence pair." + }, + "sourceAccessions": { + "type": "array", + "description": "All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally with a version number, for example `GCF_000001405.26`.", + "items": { + "type": "string" + } + }, + "ncbiTaxonId": { + "type": "integer", + "description": "ID from http://www.ncbi.nlm.nih.gov/taxonomy (e.g. 9606-\u003ehuman) if not specified by the containing reference set.", + "format": "int32" + } + } + }, + "ListBasesResponse": { + "id": "ListBasesResponse", + "type": "object", + "properties": { + "offset": { + "type": "string", + "description": "The offset position (0-based) of the given `sequence` from the start of this `Reference`. This value will differ for each page in a paginated request.", + "format": "int64" + }, + "sequence": { + "type": "string", + "description": "A substring of the bases that make up this reference." + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "ImportVariantsRequest": { + "id": "ImportVariantsRequest", + "type": "object", + "description": "The variant data import request.", + "properties": { + "variantSetId": { + "type": "string", + "description": "Required. The variant set to which variant data should be imported." + }, + "sourceUris": { + "type": "array", + "description": "A list of URIs referencing variant files in Google Cloud Storage. URIs can include wildcards [as described here](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames). Note that recursive wildcards ('**') are not supported.", + "items": { + "type": "string" + } + }, + "format": { + "type": "string", + "description": "The format of the variant data being imported. If unspecified, defaults to to `VCF`.", + "enum": [ + "FORMAT_UNSPECIFIED", + "FORMAT_VCF", + "FORMAT_COMPLETE_GENOMICS" + ] + }, + "normalizeReferenceNames": { + "type": "boolean", + "description": "Convert reference names to the canonical representation. hg19 haploytypes (those reference names containing \"_hap\") are not modified in any way. All other reference names are modified according to the following rules: The reference name is capitalized. The \"chr\" prefix is dropped for all autosomes and sex chromsomes. For example \"chr17\" becomes \"17\" and \"chrX\" becomes \"X\". All mitochondrial chromosomes (\"chrM\", \"chrMT\", etc) become \"MT\"." + } + } + }, + "VariantSet": { + "id": "VariantSet", + "type": "object", + "description": "A variant set is a collection of call sets and variants. It contains summary statistics of those contents. A variant set belongs to a dataset.", + "properties": { + "datasetId": { + "type": "string", + "description": "The dataset to which this variant set belongs." + }, + "id": { + "type": "string", + "description": "The server-generated variant set ID, unique across all variant sets." + }, + "referenceBounds": { + "type": "array", + "description": "A list of all references used by the variants in a variant set with associated coordinate upper bounds for each one.", + "items": { + "$ref": "ReferenceBound" + } + }, + "metadata": { + "type": "array", + "description": "The metadata associated with this variant set.", + "items": { + "$ref": "VariantSetMetadata" + } + } + } + }, + "ReferenceBound": { + "id": "ReferenceBound", + "type": "object", + "description": "ReferenceBound records an upper bound for the starting coordinate of variants in a particular reference.", + "properties": { + "referenceName": { + "type": "string", + "description": "The reference the bound is associate with." + }, + "upperBound": { + "type": "string", + "description": "An upper bound (inclusive) on the starting coordinate of any variant in the reference sequence.", + "format": "int64" + } + } + }, + "VariantSetMetadata": { + "id": "VariantSetMetadata", + "type": "object", + "description": "Metadata describes a single piece of variant call metadata. These data include a top level key and either a single value string (value) or a list of key-value pairs (info.) Value and info are mutually exclusive.", + "properties": { + "key": { + "type": "string", + "description": "The top-level key." + }, + "value": { + "type": "string", + "description": "The value field for simple metadata" + }, + "id": { + "type": "string", + "description": "User-provided ID field, not enforced by this API. Two or more pieces of structured metadata with identical id and key fields are considered equivalent." + }, + "type": { + "type": "string", + "description": "The type of data. Possible types include: Integer, Float, Flag, Character, and String.", + "enum": [ + "TYPE_UNSPECIFIED", + "INTEGER", + "FLOAT", + "FLAG", + "CHARACTER", + "STRING" + ] + }, + "number": { + "type": "integer", + "description": "The number of values that can be included in a field described by this metadata.", + "format": "int32" + }, + "description": { + "type": "string", + "description": "A textual description of this metadata." + }, + "info": { + "type": "object", + "description": "Remaining structured metadata key-value pairs. This must be of the form map (string key mapping to a list of string values).", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "ExportVariantSetRequest": { + "id": "ExportVariantSetRequest", + "type": "object", + "description": "The variant data export request.", + "properties": { + "callSetIds": { + "type": "array", + "description": "If provided, only variant call information from the specified call sets will be exported. By default all variant calls are exported.", + "items": { + "type": "string" + } + }, + "projectId": { + "type": "string", + "description": "Required. The Google Cloud project ID that owns the destination BigQuery dataset. The caller must have WRITE access to this project. This project will also own the resulting export job." + }, + "format": { + "type": "string", + "description": "The format for the exported data.", + "enum": [ + "FORMAT_UNSPECIFIED", + "FORMAT_BIGQUERY" + ] + }, + "bigqueryDataset": { + "type": "string", + "description": "Required. The BigQuery dataset to export data to. This dataset must already exist. Note that this is distinct from the Genomics concept of \"dataset\"." + }, + "bigqueryTable": { + "type": "string", + "description": "Required. The BigQuery table to export data to. If the table doesn't exist, it will be created. If it already exists, it will be overwritten." + } + } + }, + "SearchVariantSetsRequest": { + "id": "SearchVariantSetsRequest", + "type": "object", + "description": "The search variant sets request.", + "properties": { + "datasetIds": { + "type": "array", + "description": "Exactly one dataset ID must be provided here. Only variant sets which belong to this dataset will be returned.", + "items": { + "type": "string" + } + }, + "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." + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of variant sets to return in a request.", + "format": "int32" + } + } + }, + "SearchVariantSetsResponse": { + "id": "SearchVariantSetsResponse", + "type": "object", + "description": "The search variant sets response.", + "properties": { + "variantSets": { + "type": "array", + "description": "The variant sets belonging to the requested dataset.", + "items": { + "$ref": "VariantSet" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "SearchVariantsRequest": { + "id": "SearchVariantsRequest", + "type": "object", + "description": "The variant search request.", + "properties": { + "variantSetIds": { + "type": "array", + "description": "At most one variant set ID must be provided. Only variants from this variant set will be returned. If omitted, a call set id must be included in the request.", + "items": { + "type": "string" + } + }, + "variantName": { + "type": "string", + "description": "Only return variants which have exactly this name." + }, + "callSetIds": { + "type": "array", + "description": "Only return variant calls which belong to call sets with these ids. Leaving this blank returns all variant calls. If a variant has no calls belonging to any of these call sets, it won't be returned at all. Currently, variants with no calls from any call set will never be returned.", + "items": { + "type": "string" + } + }, + "referenceName": { + "type": "string", + "description": "Required. Only return variants in this reference sequence." + }, + "start": { + "type": "string", + "description": "The beginning of the window (0-based, inclusive) for which overlapping variants should be returned. If unspecified, defaults to 0.", + "format": "int64" + }, + "end": { + "type": "string", + "description": "The end of the window, 0-based exclusive. If unspecified or 0, defaults to the length of the reference.", + "format": "int64" + }, + "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." + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of variants to return. If unspecified, defaults to 5000.", + "format": "int32" + }, + "maxCalls": { + "type": "integer", + "description": "The maximum number of calls to return. However, at least one variant will always be returned, even if it has more calls than this limit. If unspecified, defaults to 5000.", + "format": "int32" + } + } + }, + "SearchVariantsResponse": { + "id": "SearchVariantsResponse", + "type": "object", + "description": "The variant search response.", + "properties": { + "variants": { + "type": "array", + "description": "The list of matching Variants.", + "items": { + "$ref": "Variant" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "Variant": { + "id": "Variant", + "type": "object", + "description": "A variant represents a change in DNA sequence relative to a reference sequence. For example, a variant could represent a SNP or an insertion. Variants belong to a variant set. Each of the calls on a variant represent a determination of genotype with respect to that variant. For example, a call might assign probability of 0.32 to the occurrence of a SNP named rs1234 in a sample named NA12345. A call belongs to a call set, which contains related calls typically from one sample.", + "properties": { + "variantSetId": { + "type": "string", + "description": "The ID of the variant set this variant belongs to." + }, + "id": { + "type": "string", + "description": "The server-generated variant ID, unique across all variants." + }, + "names": { + "type": "array", + "description": "Names for the variant, for example a RefSNP ID.", + "items": { + "type": "string" + } + }, + "created": { + "type": "string", + "description": "The date this variant was created, in milliseconds from the epoch.", + "format": "int64" + }, + "referenceName": { + "type": "string", + "description": "The reference on which this variant occurs. (such as `chr20` or `X`)" + }, + "start": { + "type": "string", + "description": "The position at which this variant occurs (0-based). This corresponds to the first base of the string of reference bases.", + "format": "int64" + }, + "end": { + "type": "string", + "description": "The end position (0-based) of this variant. This corresponds to the first base after the last base in the reference allele. So, the length of the reference allele is (end - start). This is useful for variants that don't explicitly give alternate bases, for example large deletions.", + "format": "int64" + }, + "referenceBases": { + "type": "string", + "description": "The reference bases for this variant. They start at the given position." + }, + "alternateBases": { + "type": "array", + "description": "The bases that appear instead of the reference bases.", + "items": { + "type": "string" + } + }, + "quality": { + "type": "number", + "description": "A measure of how likely this variant is to be real. A higher value is better.", + "format": "double" + }, + "filter": { + "type": "array", + "description": "A list of filters (normally quality filters) this variant has failed. `PASS` indicates this variant has passed all filters.", + "items": { + "type": "string" + } + }, + "info": { + "type": "object", + "description": "A map of additional variant information. This must be of the form map (string key mapping to a list of string values).", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + }, + "calls": { + "type": "array", + "description": "The variant calls for this particular variant. Each one represents the determination of genotype with respect to this variant.", + "items": { + "$ref": "VariantCall" + } + } + } + }, + "VariantCall": { + "id": "VariantCall", + "type": "object", + "description": "A call represents the determination of genotype with respect to a particular variant. It may include associated information such as quality and phasing. For example, a call might assign a probability of 0.32 to the occurrence of a SNP named rs1234 in a call set with the name NA12345.", + "properties": { + "callSetId": { + "type": "string", + "description": "The ID of the call set this variant call belongs to." + }, + "callSetName": { + "type": "string", + "description": "The name of the call set this variant call belongs to." + }, + "genotype": { + "type": "array", + "description": "The genotype of this variant call. Each value represents either the value of the `referenceBases` field or a 1-based index into `alternateBases`. If a variant had a `referenceBases` value of `T` and an `alternateBases` value of `[\"A\", \"C\"]`, and the `genotype` was `[2, 1]`, that would mean the call represented the heterozygous value `CA` for this variant. If the `genotype` was instead `[0, 1]`, the represented value would be `TA`. Ordering of the genotype values is important if the `phaseset` is present. If a genotype is not called (that is, a `.` is present in the GT string) -1 is returned.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "phaseset": { + "type": "string", + "description": "If this field is present, this variant call's genotype ordering implies the phase of the bases and is consistent with any other variant calls in the same reference sequence which have the same phaseset value. When importing data from VCF, if the genotype data was phased but no phase set was specified this field will be set to `*`." + }, + "genotypeLikelihood": { + "type": "array", + "description": "The genotype likelihoods for this variant call. Each array entry represents how likely a specific genotype is for this call. The value ordering is defined by the GL tag in the VCF spec. If Phred-scaled genotype likelihood scores (PL) are available and log10(P) genotype likelihood scores (GL) are not, PL scores are converted to GL scores. If both are available, PL scores are stored in `info`.", + "items": { + "type": "number", + "format": "double" + } + }, + "info": { + "type": "object", + "description": "A map of additional variant call information. This must be of the form map (string key mapping to a list of string values).", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "MergeVariantsRequest": { + "id": "MergeVariantsRequest", + "type": "object", + "properties": { + "variantSetId": { + "type": "string", + "description": "The destination variant set." + }, + "variants": { + "type": "array", + "description": "The variants to be merged with existing variants.", + "items": { + "$ref": "Variant" + } + } + } + }, + "SearchCallSetsRequest": { + "id": "SearchCallSetsRequest", + "type": "object", + "description": "The call set search request.", + "properties": { + "variantSetIds": { + "type": "array", + "description": "Restrict the query to call sets within the given variant sets. At least one ID must be provided.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "Only return call sets for which a substring of the name matches this string." + }, + "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." + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of call sets to return. If unspecified, defaults to 1000.", + "format": "int32" + } + } + }, + "SearchCallSetsResponse": { + "id": "SearchCallSetsResponse", + "type": "object", + "description": "The call set search response.", + "properties": { + "callSets": { + "type": "array", + "description": "The list of matching call sets.", + "items": { + "$ref": "CallSet" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "CallSet": { + "id": "CallSet", + "type": "object", + "description": "A call set is a collection of variant calls, typically for one sample. It belongs to a variant set.", + "properties": { + "id": { + "type": "string", + "description": "The server-generated call set ID, unique across all call sets." + }, + "name": { + "type": "string", + "description": "The call set name." + }, + "sampleId": { + "type": "string", + "description": "The sample ID this call set corresponds to." + }, + "variantSetIds": { + "type": "array", + "description": "The IDs of the variant sets this call set belongs to.", + "items": { + "type": "string" + } + }, + "created": { + "type": "string", + "description": "The date this call set was created in milliseconds from the epoch.", + "format": "int64" + }, + "info": { + "type": "object", + "description": "A map of additional call set information. This must be of the form map (string key mapping to a list of string values).", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "ImportReadGroupSetsResponse": { + "id": "ImportReadGroupSetsResponse", + "type": "object", + "description": "The read group set import response.", + "properties": { + "readGroupSetIds": { + "type": "array", + "description": "IDs of the read group sets that were created.", + "items": { + "type": "string" + } + } + } + }, + "ImportVariantsResponse": { + "id": "ImportVariantsResponse", + "type": "object", + "description": "The variant data import response.", + "properties": { + "callSetIds": { + "type": "array", + "description": "IDs of the call sets that were created.", + "items": { + "type": "string" + } + } + } + }, + "OperationMetadata": { + "id": "OperationMetadata", + "type": "object", + "description": "Metadata describing an [Operation][google.longrunning.Operation].", + "properties": { + "projectId": { + "type": "string", + "description": "The Google Cloud Project in which the job is scoped." + }, + "createTime": { + "type": "string", + "description": "The time at which the job was submitted to the Genomics service." + }, + "request": { + "type": "object", + "description": "The original request that started the operation. Note that this will be in current version of the API. If the operation was started with v1beta2 API and a GetOperation is performed on v1 API, a v1 request will be returned.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + }, + "events": { + "type": "array", + "description": "Optional event messages that were generated during the job's execution. This also contains any warnings that were generated during import or export.", + "items": { + "$ref": "OperationEvent" + } + } + } + }, + "OperationEvent": { + "id": "OperationEvent", + "type": "object", + "description": "An event that occurred during an [Operation][google.longrunning.Operation].", + "properties": { + "description": { + "type": "string", + "description": "Required description of event." + } + } + } + }, + "resources": { + "datasets": { + "methods": { + "list": { + "id": "genomics.datasets.list", + "path": "v1/datasets", + "httpMethod": "GET", + "description": "Lists datasets within a project.", + "parameters": { + "projectId": { + "type": "string", + "description": "Required. The project to list datasets for.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of results returned by this request. If unspecified, defaults to 50. The maximum value is 1024.", + "format": "int32", + "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" + } + }, + "response": { + "$ref": "ListDatasetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "create": { + "id": "genomics.datasets.create", + "path": "v1/datasets", + "httpMethod": "POST", + "description": "Creates a new dataset.", + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.datasets.get", + "path": "v1/datasets/{datasetId}", + "httpMethod": "GET", + "description": "Gets a dataset by ID.", + "parameters": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "patch": { + "id": "genomics.datasets.patch", + "path": "v1/datasets/{datasetId}", + "httpMethod": "PATCH", + "description": "Updates a dataset. This method supports patch semantics.", + "parameters": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset to be updated.", + "required": true, + "location": "path" + }, + "updateMask": { + "type": "string", + "description": "An optional mask specifying which fields to update. At this time, the only mutable field is [name][google.genomics.v1.Dataset.name]. The only acceptable value is \"name\". If unspecified, all mutable fields will be updated.", + "location": "query" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.datasets.delete", + "path": "v1/datasets/{datasetId}", + "httpMethod": "DELETE", + "description": "Deletes a dataset.", + "parameters": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "undelete": { + "id": "genomics.datasets.undelete", + "path": "v1/datasets/{datasetId}:undelete", + "httpMethod": "POST", + "description": "Undeletes a dataset by restoring a dataset which was deleted via this API. This operation is only possible for a week after the deletion occurred.", + "parameters": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset to be undeleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "UndeleteDatasetRequest" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + }, + "operations": { + "methods": { + "get": { + "id": "genomics.operations.get", + "path": "v1/{+name}", + "httpMethod": "GET", + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the operation resource.", + "required": true, + "pattern": "^operations/.*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "list": { + "id": "genomics.operations.list", + "path": "v1/{+name}", + "httpMethod": "GET", + "description": "Lists operations that match the specified filter in the request.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the operation collection.", + "required": true, + "pattern": "^operations$", + "location": "path" + }, + "filter": { + "type": "string", + "description": "A string for filtering [Operations][google.longrunning.Operation]. The following filter fields are supported: * projectId: Required. Corresponds to [OperationMetadata.projectId][google.genomics.v1.OperationMetadata.project_id]. * createTime: The time this job was created, in seconds from the [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `\u003e=` and/or `= 1432140000` * `projectId = my-project AND createTime \u003e= 1432140000 AND createTime \u003c= 1432150000 AND status = RUNNING`", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of results to return. If unspecified, defaults to 256. The maximum value is 2048.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The standard List page token.", + "location": "query" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "cancel": { + "id": "genomics.operations.cancel", + "path": "v1/{+name}:cancel", + "httpMethod": "POST", + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use [Operations.GetOperation][google.longrunning.Operations.GetOperation] or [Operations.ListOperations][google.longrunning.Operations.ListOperations] to check whether the cancellation succeeded or the operation completed despite cancellation.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the operation resource to be cancelled.", + "required": true, + "pattern": "^operations/.*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "CancelOperationRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.operations.delete", + "path": "v1/{+name}", + "httpMethod": "DELETE", + "description": "This method is not implemented. To cancel an operation, please use [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].", + "parameters": { + "name": { + "type": "string", + "description": "The name of the operation resource to be deleted.", + "required": true, + "pattern": "^operations/.*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + }, + "readgroupsets": { + "methods": { + "import": { + "id": "genomics.readgroupsets.import", + "path": "v1/readgroupsets:import", + "httpMethod": "POST", + "description": "Creates read group sets by asynchronously importing the provided information. Note that currently comments in the input file header are **not** imported and some custom tags will be converted to strings, rather than preserving tag types. The caller must have WRITE permissions to the dataset.", + "request": { + "$ref": "ImportReadGroupSetsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ] + }, + "export": { + "id": "genomics.readgroupsets.export", + "path": "v1/readgroupsets/{readGroupSetId}:export", + "httpMethod": "POST", + "description": "Exports a read group set to a BAM file in Google Cloud Storage. Note that currently there may be some differences between exported BAM files and the original BAM file at the time of import. In particular, comments in the input file header will not be preserved, some custom tags will be converted to strings, and original reference sequence order is not necessarily preserved.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "Required. The ID of the read group set to export.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "request": { + "$ref": "ExportReadGroupSetRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ] + }, + "search": { + "id": "genomics.readgroupsets.search", + "path": "v1/readgroupsets/search", + "httpMethod": "POST", + "description": "Searches for read group sets matching the criteria. Implements [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135).", + "request": { + "$ref": "SearchReadGroupSetsRequest" + }, + "response": { + "$ref": "SearchReadGroupSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "patch": { + "id": "genomics.readgroupsets.patch", + "path": "v1/readgroupsets/{readGroupSetId}", + "httpMethod": "PATCH", + "description": "Updates a read group set. This method supports patch semantics.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set.", + "required": true, + "location": "path" + }, + "updateMask": { + "type": "string", + "description": "An optional mask specifying which fields to update. At this time, mutable fields are [referenceSetId][google.genomics.v1.ReadGroupSet.reference_set_id] and [name][google.genomics.v1.ReadGroupSet.name]. Acceptable values are \"referenceSetId\" and \"name\". If unspecified, all mutable fields will be updated.", + "location": "query" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "request": { + "$ref": "ReadGroupSet" + }, + "response": { + "$ref": "ReadGroupSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.readgroupsets.delete", + "path": "v1/readgroupsets/{readGroupSetId}", + "httpMethod": "DELETE", + "description": "Deletes a read group set.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set to be deleted. The caller must have WRITE permissions to the dataset associated with this read group set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.readgroupsets.get", + "path": "v1/readgroupsets/{readGroupSetId}", + "httpMethod": "GET", + "description": "Gets a read group set by ID.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "response": { + "$ref": "ReadGroupSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + }, + "resources": { + "coveragebuckets": { + "methods": { + "list": { + "id": "genomics.readgroupsets.coveragebuckets.list", + "path": "v1/readgroupsets/{readGroupSetId}/coveragebuckets", + "httpMethod": "GET", + "description": "Lists fixed width coverage buckets for a read group set, each of which correspond to a range of a reference sequence. Each bucket summarizes coverage information across its corresponding genomic range. Coverage is defined as the number of reads which are aligned to a given base in the reference sequence. Coverage buckets are available at several precomputed bucket widths, enabling retrieval of various coverage 'zoom levels'. The caller must have READ permissions for the target read group set.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "Required. The ID of the read group set over which coverage is requested.", + "required": true, + "location": "path" + }, + "referenceName": { + "type": "string", + "description": "The name of the reference to query, within the reference set associated with this query. Optional.", + "location": "query" + }, + "start": { + "type": "string", + "description": "The start position of the range on the reference, 0-based inclusive. If specified, `referenceName` must also be specified. Defaults to 0.", + "format": "int64", + "location": "query" + }, + "end": { + "type": "string", + "description": "The end position of the range on the reference, 0-based exclusive. If specified, `referenceName` must also be specified. If unset or 0, defaults to the length of the reference.", + "format": "int64", + "location": "query" + }, + "targetBucketWidth": { + "type": "string", + "description": "The desired width of each reported coverage bucket in base pairs. This will be rounded down to the nearest precomputed bucket width; the value of which is returned as `bucketWidth` in the response. Defaults to infinity (each bucket spans an entire reference sequence) or the length of the target range, if specified. The smallest precomputed `bucketWidth` is currently 2048 base pairs; this is subject to change.", + "format": "int64", + "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" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of results to return in a single page. If unspecified, defaults to 1024. The maximum value is 2048.", + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "response": { + "$ref": "ListCoverageBucketsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + } + } + }, + "reads": { + "methods": { + "search": { + "id": "genomics.reads.search", + "path": "v1/reads/search", + "httpMethod": "POST", + "description": "Gets a list of reads for one or more read group sets. Reads search operates over a genomic coordinate space of reference sequence & position defined over the reference sequences to which the requested read group sets are aligned. If a target positional range is specified, search returns all reads whose alignment to the reference genome overlap the range. A query which specifies only read group set IDs yields all reads in those read group sets, including unmapped reads. All reads returned (including reads on subsequent pages) are ordered by genomic coordinate (reference sequence & position). Reads with equivalent genomic coordinates are returned in a deterministic order. Implements [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85).", + "request": { + "$ref": "SearchReadsRequest" + }, + "response": { + "$ref": "SearchReadsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + }, + "referencesets": { + "methods": { + "search": { + "id": "genomics.referencesets.search", + "path": "v1/referencesets/search", + "httpMethod": "POST", + "description": "Searches for reference sets which match the given criteria. Implements [GlobalAllianceApi.searchReferenceSets](http://ga4gh.org/documentation/api/v0.5.1/ga4gh_api.html#/schema/org.ga4gh.searchReferenceSets).", + "request": { + "$ref": "SearchReferenceSetsRequest" + }, + "response": { + "$ref": "SearchReferenceSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "get": { + "id": "genomics.referencesets.get", + "path": "v1/referencesets/{referenceSetId}", + "httpMethod": "GET", + "description": "Gets a reference set. Implements [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83).", + "parameters": { + "referenceSetId": { + "type": "string", + "description": "The ID of the reference set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "referenceSetId" + ], + "response": { + "$ref": "ReferenceSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + }, + "references": { + "methods": { + "search": { + "id": "genomics.references.search", + "path": "v1/references/search", + "httpMethod": "POST", + "description": "Searches for references which match the given criteria. Implements [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146).", + "request": { + "$ref": "SearchReferencesRequest" + }, + "response": { + "$ref": "SearchReferencesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "get": { + "id": "genomics.references.get", + "path": "v1/references/{referenceId}", + "httpMethod": "GET", + "description": "Gets a reference. Implements [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158).", + "parameters": { + "referenceId": { + "type": "string", + "description": "The ID of the reference.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "referenceId" + ], + "response": { + "$ref": "Reference" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + }, + "resources": { + "bases": { + "methods": { + "list": { + "id": "genomics.references.bases.list", + "path": "v1/references/{referenceId}/bases", + "httpMethod": "GET", + "description": "Lists the bases in a reference, optionally restricted to a range. Implements [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221).", + "parameters": { + "referenceId": { + "type": "string", + "description": "The ID of the reference.", + "required": true, + "location": "path" + }, + "start": { + "type": "string", + "description": "The start position (0-based) of this query. Defaults to 0.", + "format": "int64", + "location": "query" + }, + "end": { + "type": "string", + "description": "The end position (0-based, exclusive) of this query. Defaults to the length of this reference.", + "format": "int64", + "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" + }, + "pageSize": { + "type": "integer", + "description": "Specifies the maximum number of bases to return in a single page.", + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "referenceId" + ], + "response": { + "$ref": "ListBasesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + } + } + }, + "variants": { + "methods": { + "import": { + "id": "genomics.variants.import", + "path": "v1/variants:import", + "httpMethod": "POST", + "description": "Creates variant data by asynchronously importing the provided information. The variants for import will be merged with any existing data and each other according to the behavior of mergeVariants. In particular, this means for merged VCF variants that have conflicting INFO fields, some data will be arbitrarily discarded. As a special case, for single-sample VCF files, QUAL and FILTER fields will be moved to the call level; these are sometimes interpreted in a call-specific context. Imported VCF headers are appended to the metadata already in a variant set.", + "request": { + "$ref": "ImportVariantsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ] + }, + "search": { + "id": "genomics.variants.search", + "path": "v1/variants/search", + "httpMethod": "POST", + "description": "Gets a list of variants matching the criteria. Implements [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126).", + "request": { + "$ref": "SearchVariantsRequest" + }, + "response": { + "$ref": "SearchVariantsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "create": { + "id": "genomics.variants.create", + "path": "v1/variants", + "httpMethod": "POST", + "description": "Creates a new variant.", + "request": { + "$ref": "Variant" + }, + "response": { + "$ref": "Variant" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "patch": { + "id": "genomics.variants.patch", + "path": "v1/variants/{variantId}", + "httpMethod": "PATCH", + "description": "Updates a variant. This method supports patch semantics. Returns the modified variant without its calls.", + "parameters": { + "variantId": { + "type": "string", + "description": "The ID of the variant to be updated.", + "required": true, + "location": "path" + }, + "updateMask": { + "type": "string", + "description": "An optional mask specifying which fields to update. At this time, mutable fields are [names][google.genomics.v1.Variant.names] and [info][google.genomics.v1.Variant.info]. Acceptable values are \"names\" and \"info\". If unspecified, all mutable fields will be updated.", + "location": "query" + } + }, + "parameterOrder": [ + "variantId" + ], + "request": { + "$ref": "Variant" + }, + "response": { + "$ref": "Variant" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.variants.delete", + "path": "v1/variants/{variantId}", + "httpMethod": "DELETE", + "description": "Deletes a variant.", + "parameters": { + "variantId": { + "type": "string", + "description": "The ID of the variant to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.variants.get", + "path": "v1/variants/{variantId}", + "httpMethod": "GET", + "description": "Gets a variant by ID.", + "parameters": { + "variantId": { + "type": "string", + "description": "The ID of the variant.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantId" + ], + "response": { + "$ref": "Variant" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "merge": { + "id": "genomics.variants.merge", + "path": "v1/variants:merge", + "httpMethod": "POST", + "description": "Merges the given variants with existing variants. Each variant will be merged with an existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant, and other fields (such as key/value pairs) are discarded.", + "request": { + "$ref": "MergeVariantsRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + }, + "variantsets": { + "methods": { + "create": { + "id": "genomics.variantsets.create", + "path": "v1/variantsets", + "httpMethod": "POST", + "description": "Creates a new variant set.", + "request": { + "$ref": "VariantSet" + }, + "response": { + "$ref": "VariantSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "export": { + "id": "genomics.variantsets.export", + "path": "v1/variantsets/{variantSetId}:export", + "httpMethod": "POST", + "description": "Exports variant set data to an external destination.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "Required. The ID of the variant set that contains variant data which should be exported. The caller must have READ access to this variant set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "request": { + "$ref": "ExportVariantSetRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.variantsets.get", + "path": "v1/variantsets/{variantSetId}", + "httpMethod": "GET", + "description": "Gets a variant set by ID.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "Required. The ID of the variant set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "response": { + "$ref": "VariantSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "search": { + "id": "genomics.variantsets.search", + "path": "v1/variantsets/search", + "httpMethod": "POST", + "description": "Returns a list of all variant sets matching search criteria. Implements [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49).", + "request": { + "$ref": "SearchVariantSetsRequest" + }, + "response": { + "$ref": "SearchVariantSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "delete": { + "id": "genomics.variantsets.delete", + "path": "v1/variantsets/{variantSetId}", + "httpMethod": "DELETE", + "description": "Deletes the contents of a variant set. The variant set object is not deleted.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "The ID of the variant set to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "patch": { + "id": "genomics.variantsets.patch", + "path": "v1/variantsets/{variantSetId}", + "httpMethod": "PATCH", + "description": "Updates a variant set. This method supports patch semantics.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "The ID of the variant to be updated (must already exist).", + "required": true, + "location": "path" + }, + "updateMask": { + "type": "string", + "description": "An optional mask specifying which fields to update. At this time, the only mutable field is [metadata][google.genomics.v1.VariantSet.metadata]. The only acceptable value is \"metadata\". If unspecified, all mutable fields will be updated.", + "location": "query" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "request": { + "$ref": "VariantSet" + }, + "response": { + "$ref": "VariantSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + }, + "callsets": { + "methods": { + "search": { + "id": "genomics.callsets.search", + "path": "v1/callsets/search", + "httpMethod": "POST", + "description": "Gets a list of call sets matching the criteria. Implements [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178).", + "request": { + "$ref": "SearchCallSetsRequest" + }, + "response": { + "$ref": "SearchCallSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "create": { + "id": "genomics.callsets.create", + "path": "v1/callsets", + "httpMethod": "POST", + "description": "Creates a new call set.", + "request": { + "$ref": "CallSet" + }, + "response": { + "$ref": "CallSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "patch": { + "id": "genomics.callsets.patch", + "path": "v1/callsets/{callSetId}", + "httpMethod": "PATCH", + "description": "Updates a call set. This method supports patch semantics.", + "parameters": { + "callSetId": { + "type": "string", + "description": "The ID of the call set to be updated.", + "required": true, + "location": "path" + }, + "updateMask": { + "type": "string", + "description": "An optional mask specifying which fields to update. At this time, the only mutable field is [name][google.genomics.v1.CallSet.name]. The only acceptable value is \"name\". If unspecified, all mutable fields will be updated.", + "location": "query" + } + }, + "parameterOrder": [ + "callSetId" + ], + "request": { + "$ref": "CallSet" + }, + "response": { + "$ref": "CallSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.callsets.delete", + "path": "v1/callsets/{callSetId}", + "httpMethod": "DELETE", + "description": "Deletes a call set.", + "parameters": { + "callSetId": { + "type": "string", + "description": "The ID of the call set to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "callSetId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.callsets.get", + "path": "v1/callsets/{callSetId}", + "httpMethod": "GET", + "description": "Gets a call set by ID.", + "parameters": { + "callSetId": { + "type": "string", + "description": "The ID of the call set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "callSetId" + ], + "response": { + "$ref": "CallSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + } } } diff --git a/etc/api/genomics/v1beta2/genomics-api.json b/etc/api/genomics/v1beta2/genomics-api.json index 349c9e665f..6863c140dc 100644 --- a/etc/api/genomics/v1beta2/genomics-api.json +++ b/etc/api/genomics/v1beta2/genomics-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/5Ip5gxD2IW-n7qngRG7WOKp94TA\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/hlRrQoFUbR1DFyke-B8BPXehGzw\"", "discoveryVersion": "v1", "id": "genomics:v1beta2", "name": "genomics", "version": "v1beta2", - "revision": "20150618", + "revision": "20150715", "title": "Genomics API", "description": "Provides access to Genomics data.", "ownerDomain": "google.com", @@ -2925,7 +2925,7 @@ }, "projectNumber": { "type": "string", - "description": "The project to list datasets for.", + "description": "Required. The project to list datasets for.", "format": "int64", "location": "query" } @@ -3644,6 +3644,18 @@ }, "variantsets": { "methods": { + "create": { + "id": "genomics.variantsets.create", + "path": "variantsets", + "httpMethod": "POST", + "description": "Creates a new variant set (only necessary in v1).", + "request": { + "$ref": "VariantSet" + }, + "response": { + "$ref": "VariantSet" + } + }, "delete": { "id": "genomics.variantsets.delete", "path": "variantsets/{variantSetId}", diff --git a/etc/api/identitytoolkit/v3/identitytoolkit-api.json b/etc/api/identitytoolkit/v3/identitytoolkit-api.json index b35c94bd8e..71b2c3eff4 100644 --- a/etc/api/identitytoolkit/v3/identitytoolkit-api.json +++ b/etc/api/identitytoolkit/v3/identitytoolkit-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Xnfg-4IS066IVT9k9SbG9wAvQdM\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/GjMYVSVyLqOyv-ANl0uM1bR0w3c\"", "discoveryVersion": "v1", "id": "identitytoolkit:v3", "name": "identitytoolkit", "canonicalName": "Identity Toolkit", "version": "v3", - "revision": "20150513", + "revision": "20150710", "title": "Google Identity Toolkit API", "description": "Help the third party sites to implement federated login.", "ownerDomain": "google.com", diff --git a/etc/api/mapsengine/exp2/mapsengine-api.json b/etc/api/mapsengine/exp2/mapsengine-api.json index 3328c0461d..0e5606fc51 100644 --- a/etc/api/mapsengine/exp2/mapsengine-api.json +++ b/etc/api/mapsengine/exp2/mapsengine-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/8oOHNt5Z8JBzECjRSkqiQAiaen0\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/wiXdhd46w7148RUP_c2NQwC8k50\"", "discoveryVersion": "v1", "id": "mapsengine:exp2", "name": "mapsengine", "canonicalName": "Maps Engine", "version": "exp2", - "revision": "20150611", + "revision": "20150629", "title": "Google Maps Engine API", "description": "The Google Maps Engine API allows developers to store and query geospatial vector and raster data.", "ownerDomain": "google.com", diff --git a/etc/api/mapsengine/v1/mapsengine-api.json b/etc/api/mapsengine/v1/mapsengine-api.json index 70868a58f7..0e4df2f06f 100644 --- a/etc/api/mapsengine/v1/mapsengine-api.json +++ b/etc/api/mapsengine/v1/mapsengine-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/L-PdcZxSM_jnMBtOdR1xH2_5Kvk\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/v-eOcb_2yOgozMnj3_3VkSFffEI\"", "discoveryVersion": "v1", "id": "mapsengine:v1", "name": "mapsengine", "canonicalName": "Maps Engine", "version": "v1", - "revision": "20150611", + "revision": "20150629", "title": "Google Maps Engine API", "description": "The Google Maps Engine API allows developers to store and query geospatial vector and raster data.", "ownerDomain": "google.com", diff --git a/etc/api/oauth2/v1/oauth2-api.json b/etc/api/oauth2/v1/oauth2-api.json index 4ee585d44a..c7142e8cc2 100644 --- a/etc/api/oauth2/v1/oauth2-api.json +++ b/etc/api/oauth2/v1/oauth2-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/yBXWUg3_16xGrw-wakFJ4iOdZt0\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/E7VrRWc2416Btp9uIQ42rmbOltA\"", "discoveryVersion": "v1", "id": "oauth2:v1", "name": "oauth2", "version": "v1", - "revision": "20150526", + "revision": "20150714", "title": "Google OAuth2 API", "description": "Lets you access OAuth2 protocol related APIs.", "ownerDomain": "google.com", @@ -85,6 +85,41 @@ } }, "schemas": { + "Jwk": { + "id": "Jwk", + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alg": { + "type": "string", + "default": "RS256" + }, + "e": { + "type": "string" + }, + "kid": { + "type": "string" + }, + "kty": { + "type": "string", + "default": "RSA" + }, + "n": { + "type": "string" + }, + "use": { + "type": "string", + "default": "sig" + } + } + } + } + } + }, "Raw": { "id": "Raw", "type": "object", @@ -244,6 +279,25 @@ "$ref": "Raw" } }, + "getRobotJwk": { + "id": "oauth2.getRobotJwk", + "path": "service_accounts/v1/jwk/{robotEmail}", + "httpMethod": "GET", + "parameters": { + "robotEmail": { + "type": "string", + "description": "The email of robot account.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "robotEmail" + ], + "response": { + "$ref": "Jwk" + } + }, "getRobotMetadataRaw": { "id": "oauth2.getRobotMetadataRaw", "path": "service_accounts/v1/metadata/raw/{robotEmail}", diff --git a/etc/api/oauth2/v2/oauth2-api.json b/etc/api/oauth2/v2/oauth2-api.json index d0a31f9474..5c66f64579 100644 --- a/etc/api/oauth2/v2/oauth2-api.json +++ b/etc/api/oauth2/v2/oauth2-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/rnj_scS00W_RQszceDwCfUJUSKk\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/OFeFpj7h7BFiyShP6KkN87ag7EM\"", "discoveryVersion": "v1", "id": "oauth2:v2", "name": "oauth2", "version": "v2", - "revision": "20150526", + "revision": "20150714", "title": "Google OAuth2 API", "description": "Lets you access OAuth2 protocol related APIs.", "ownerDomain": "google.com", diff --git a/etc/api/plus/v1/plus-api.json b/etc/api/plus/v1/plus-api.json index e47d7f8522..e821175a29 100644 --- a/etc/api/plus/v1/plus-api.json +++ b/etc/api/plus/v1/plus-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/00M-qZjkQ13qgsdq5akamAJBPOQ\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/I74wFQ2PdmMDOsAx2BuCGBOq9uQ\"", "discoveryVersion": "v1", "id": "plus:v1", "name": "plus", "version": "v1", - "revision": "20150616", + "revision": "20150719", "title": "Google+ API", "description": "The Google+ API enables developers to build on top of the Google+ platform.", "ownerDomain": "google.com", diff --git a/etc/api/plusdomains/v1/plusdomains-api.json b/etc/api/plusdomains/v1/plusdomains-api.json index 441e67116f..8478000193 100644 --- a/etc/api/plusdomains/v1/plusdomains-api.json +++ b/etc/api/plusdomains/v1/plusdomains-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ejQnj8VHVMpn-Gq4BhGLmqZIhZI\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/HcXhUaCYj8k7XjNpIaT--1ZP6rY\"", "discoveryVersion": "v1", "id": "plusDomains:v1", "name": "plusDomains", "version": "v1", - "revision": "20150616", + "revision": "20150719", "title": "Google+ Domains API", "description": "The Google+ API enables developers to build on top of the Google+ platform.", "ownerDomain": "google.com", diff --git a/etc/api/pubsub/v1beta1a/pubsub-api.json b/etc/api/pubsub/v1beta1a/pubsub-api.json index bb20aaf126..2295e3bf2c 100644 --- a/etc/api/pubsub/v1beta1a/pubsub-api.json +++ b/etc/api/pubsub/v1beta1a/pubsub-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/7dF_Pdkn9CaqP2VR3Xvya3Y17a8\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/qGYIx74Qi92EX9k6GZSlKoaG6o4\"", "discoveryVersion": "v1", "id": "pubsub:v1beta1a", "name": "pubsub", "version": "v1beta1a", - "revision": "20150427", + "revision": "20150604", "title": "Google Cloud Pub/Sub API", "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", "ownerDomain": "google.com", diff --git a/etc/api/pubsub/v1beta2/pubsub-api.json b/etc/api/pubsub/v1beta2/pubsub-api.json index 90b7262182..b434fdd9d3 100644 --- a/etc/api/pubsub/v1beta2/pubsub-api.json +++ b/etc/api/pubsub/v1beta2/pubsub-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/VK6LFY090HaPGVrEqnv6Rpqzlmo\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/jJarxdUjZcANpaMjt3kLHFRtpJA\"", "discoveryVersion": "v1", "id": "pubsub:v1beta2", "name": "pubsub", "version": "v1beta2", - "revision": "20150427", + "revision": "20150604", "title": "Google Cloud Pub/Sub API", "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", "ownerDomain": "google.com", @@ -127,11 +127,11 @@ "Policy": { "id": "Policy", "type": "object", - "description": "# Overview The `Policy` defines an access control policy language. It can be used to define policies that can be attached to resources like files, folders, VMs, etc. # Policy structure A `Policy` consists of a list of bindings. A `Binding` binds a set of members to a role, where the members can include user accounts, user groups, user domains, and service accounts. A role is a named set of permissions, defined by the IAM system. The definition of a role is outside the policy. A permission check involves determining the roles that include the specified permission, and then determining if the principal specified by the check is a member of a binding to at least one of these roles. The membership check is recursive when a group is bound to a role. Policy examples: ``` { \"bindings\": [ { \"role\": \"roles/owner\", \"members\": [ \"user:mike@example.com\", \"group::admins@example.com\", \"domain:google.com\", \"serviceAccount:frontend@example.iam.gserviceaccounts.com\"] }, { \"role\": \"roles/viewer\", \"members\": [\"user:sean@example.com\"] } ] } ```", + "description": "# Overview The `Policy` defines an access control policy language. It is used to define policies that are attached to resources like files, folders, VMs, etc. # Policy structure A `Policy` consists of a list of bindings. A `Binding` binds a set of members to a role, where the members include user accounts, user groups, user domains, and service accounts. A 'role' is a named set of permissions, defined by IAM. The definition of a role is outside the policy. A permission check first determines the roles that include the specified permission, and then determines if the principal specified is a member of a binding to at least one of these roles. The membership check is recursive when a group is bound to a role. Policy examples: ``` { \"bindings\": [ { \"role\": \"roles/owner\", \"members\": [ \"user:mike@example.com\", \"group:admins@example.com\", \"domain:google.com\", \"serviceAccount:frontend@example.iam.gserviceaccounts.com\"] }, { \"role\": \"roles/viewer\", \"members\": [\"user:sean@example.com\"] } ] } ```", "properties": { "version": { "type": "integer", - "description": "The policy language version. The version of the policy itself is represented by the etag. The current version is 0.", + "description": "The policy language version. The version of the policy is represented by the etag. The default version is 0.", "format": "int32" }, "bindings": { @@ -157,7 +157,7 @@ "Binding": { "id": "Binding", "type": "object", - "description": "Associates members of various types with roles. See below for details of the various objects that can be included as members.", + "description": "Associates members with roles. See below for allowed formats of members.", "properties": { "role": { "type": "string", @@ -363,7 +363,7 @@ "properties": { "name": { "type": "string", - "description": "The name of the topic. It must have the format \"projects/{project}/topics/{topic}\" for Google Cloud Pub/Sub API v1beta2. {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with \"goog\"." + "description": "The name of the topic. It must have the format \"projects/{project}/topics/{topic}\" for Google Cloud Pub/Sub API v1 and v1beta2. {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with \"goog\"." } } }, @@ -457,7 +457,7 @@ "Empty": { "id": "Empty", "type": "object", - "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }" + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`." }, "Subscription": { "id": "Subscription", @@ -466,11 +466,11 @@ "properties": { "name": { "type": "string", - "description": "The name of the subscription. It must have the format \"projects/{project}/subscriptions/{subscription}\" for Google Cloud Pub/Sub API v1beta2. {subscription} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with \"goog\"." + "description": "The name of the subscription. It must have the format \"projects/{project}/subscriptions/{subscription}\" for Google Cloud Pub/Sub API v1 and v1beta2. {subscription} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with \"goog\"." }, "topic": { "type": "string", - "description": "The name of the topic from which this subscription is receiving messages. This will be present if and only if the subscription has not been detached from its topic." + "description": "The name of the topic from which this subscription is receiving messages. The value of this field will be `_deleted-topic_` if the topic has been deleted." }, "pushConfig": { "$ref": "PushConfig", @@ -526,7 +526,7 @@ "properties": { "ackId": { "type": "string", - "description": "The acknowledgment ID." + "description": "The acknowledgment ID. Either this or ack_ids must be populated, but not both." }, "ackIds": { "type": "array", @@ -626,7 +626,7 @@ "parameters": { "resource": { "type": "string", - "description": "REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}.", + "description": "REQUIRED: The resource for which policy is being specified. Resource is usually specified as a path, such as, projects/{project}/zones/{zone}/disks/{disk}.", "required": true, "pattern": "^projects/[^/]*/topics/[^/]*$", "location": "path" @@ -650,11 +650,11 @@ "id": "pubsub.projects.topics.getIamPolicy", "path": "v1beta2/{+resource}:getIamPolicy", "httpMethod": "GET", - "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + "description": "Gets the access control policy for a resource. Is empty if the policy or the resource does not exist.", "parameters": { "resource": { "type": "string", - "description": "REQUIRED: The resource for which policy is being requested. Usually some path like projects/{project}.", + "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, projects/{project}.", "required": true, "pattern": "^projects/[^/]*/topics/[^/]*$", "location": "path" @@ -679,7 +679,7 @@ "parameters": { "resource": { "type": "string", - "description": "REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}.", + "description": "REQUIRED: The resource for which policy detail is being requested. Resource is usually specified as a path, such as, projects/{project}.", "required": true, "pattern": "^projects/[^/]*/topics/[^/]*$", "location": "path" @@ -707,7 +707,7 @@ "parameters": { "name": { "type": "string", - "description": "The name of the topic. It must have the format \"projects/{project}/topics/{topic}\" for Google Cloud Pub/Sub API v1beta2. {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with \"goog\".", + "description": "The name of the topic. It must have the format \"projects/{project}/topics/{topic}\" for Google Cloud Pub/Sub API v1 and v1beta2. {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with \"goog\".", "required": true, "pattern": "^projects/[^/]*/topics/[^/]*$", "location": "path" @@ -820,7 +820,7 @@ "id": "pubsub.projects.topics.delete", "path": "v1beta2/{+topic}", "httpMethod": "DELETE", - "description": "Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted.", + "description": "Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their `topic` field is set to `_deleted-topic_`.", "parameters": { "topic": { "type": "string", @@ -895,7 +895,7 @@ "parameters": { "resource": { "type": "string", - "description": "REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}.", + "description": "REQUIRED: The resource for which policy is being specified. Resource is usually specified as a path, such as, projects/{project}/zones/{zone}/disks/{disk}.", "required": true, "pattern": "^projects/[^/]*/subscriptions/[^/]*$", "location": "path" @@ -919,11 +919,11 @@ "id": "pubsub.projects.subscriptions.getIamPolicy", "path": "v1beta2/{+resource}:getIamPolicy", "httpMethod": "GET", - "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + "description": "Gets the access control policy for a resource. Is empty if the policy or the resource does not exist.", "parameters": { "resource": { "type": "string", - "description": "REQUIRED: The resource for which policy is being requested. Usually some path like projects/{project}.", + "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, projects/{project}.", "required": true, "pattern": "^projects/[^/]*/subscriptions/[^/]*$", "location": "path" @@ -948,7 +948,7 @@ "parameters": { "resource": { "type": "string", - "description": "REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}.", + "description": "REQUIRED: The resource for which policy detail is being requested. Resource is usually specified as a path, such as, projects/{project}.", "required": true, "pattern": "^projects/[^/]*/subscriptions/[^/]*$", "location": "path" @@ -976,7 +976,7 @@ "parameters": { "name": { "type": "string", - "description": "The name of the subscription. It must have the format \"projects/{project}/subscriptions/{subscription}\" for Google Cloud Pub/Sub API v1beta2. {subscription} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with \"goog\".", + "description": "The name of the subscription. It must have the format \"projects/{project}/subscriptions/{subscription}\" for Google Cloud Pub/Sub API v1 and v1beta2. {subscription} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with \"goog\".", "required": true, "pattern": "^projects/[^/]*/subscriptions/[^/]*$", "location": "path" diff --git a/etc/api/replicapool/v1beta1/replicapool-api.json b/etc/api/replicapool/v1beta1/replicapool-api.json index db51aec81d..04820cbba6 100644 --- a/etc/api/replicapool/v1beta1/replicapool-api.json +++ b/etc/api/replicapool/v1beta1/replicapool-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/KkobOVPADtxrtyAljKA-ewKM_k8\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/bbBsSTsXQi92V3hzGiyxok5bZF0\"", "discoveryVersion": "v1", "id": "replicapool:v1beta1", "name": "replicapool", "version": "v1beta1", - "revision": "20150311", + "revision": "20150708", "title": "Replica Pool API", "description": "The Replica Pool API allows users to declaratively provision and manage groups of Google Compute Engine instances based on a common template.", "ownerDomain": "google.com", diff --git a/etc/api/replicapool/v1beta2/replicapool-api.json b/etc/api/replicapool/v1beta2/replicapool-api.json index 5a6d686487..fe0737bb37 100644 --- a/etc/api/replicapool/v1beta2/replicapool-api.json +++ b/etc/api/replicapool/v1beta2/replicapool-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/H3mDQDqOlflMvFSf76ymqE9zKI8\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/QPdxF7lKZPugyM4sPnwbbuOltwY\"", "discoveryVersion": "v1", "id": "replicapool:v1beta2", "name": "replicapool", "version": "v1beta2", - "revision": "20150311", + "revision": "20150708", "title": "Google Compute Engine Instance Group Manager API", "description": "The Google Compute Engine Instance Group Manager API provides groups of homogenous Compute Engine Instances.", "ownerDomain": "google.com", @@ -483,6 +483,18 @@ "id": "ReplicaPoolAutoHealingPolicy", "type": "object", "properties": { + "actionType": { + "type": "string", + "description": "The action to perform when an instance becomes unhealthy. Possible values are RECREATE or REBOOT. RECREATE replaces an unhealthy instance with a new instance that is based on the instance template for this managed instance group. REBOOT performs a soft reboot on an instance. If the instance cannot reboot, the instance performs a hard restart.", + "enum": [ + "REBOOT", + "RECREATE" + ], + "enumDescriptions": [ + "", + "" + ] + }, "healthCheck": { "type": "string", "description": "The URL for the HealthCheck that signals autohealing." diff --git a/etc/api/resourceviews/v1beta1/resourceviews-api.json b/etc/api/resourceviews/v1beta1/resourceviews-api.json index 14ffb1f0e0..0025d167ce 100644 --- a/etc/api/resourceviews/v1beta1/resourceviews-api.json +++ b/etc/api/resourceviews/v1beta1/resourceviews-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/TwzIqxwm2upGzUuQcHyTEbUiBn4\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/cQvoowMiSr7N8G8JWSVMnopHtSU\"", "discoveryVersion": "v1", "id": "resourceviews:v1beta1", "name": "resourceviews", "version": "v1beta1", - "revision": "20150326", + "revision": "20150708", "title": "Resource Views API", "description": "The Resource View API allows users to create and manage logical sets of Google Compute Engine instances.", "ownerDomain": "google.com", diff --git a/etc/api/resourceviews/v1beta2/resourceviews-api.json b/etc/api/resourceviews/v1beta2/resourceviews-api.json index 87acc327a9..3d150f6e2a 100644 --- a/etc/api/resourceviews/v1beta2/resourceviews-api.json +++ b/etc/api/resourceviews/v1beta2/resourceviews-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/7vqttKoTimAxrx1G-cjy6Zjv7-U\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Czl2mkcl-UOWxqwK4LFExYmF-RA\"", "discoveryVersion": "v1", "id": "resourceviews:v1beta2", "name": "resourceviews", "version": "v1beta2", - "revision": "20150326", + "revision": "20150708", "title": "Google Compute Engine Instance Groups API", "description": "The Resource View API allows users to create and manage logical sets of Google Compute Engine instances.", "ownerDomain": "google.com", diff --git a/etc/api/sqladmin/v1beta3/sqladmin-api.json b/etc/api/sqladmin/v1beta3/sqladmin-api.json index 97bfdea54e..7194ad6576 100644 --- a/etc/api/sqladmin/v1beta3/sqladmin-api.json +++ b/etc/api/sqladmin/v1beta3/sqladmin-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/gwo7J97ILJAQ8gO-rmiOBs_ZkKc\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/3wqGzGH7n55HIf3ZiG2TqGSB2lQ\"", "discoveryVersion": "v1", "id": "sqladmin:v1beta3", "name": "sqladmin", "canonicalName": "SQL Admin", "version": "v1beta3", - "revision": "20150330", + "revision": "20150305", "title": "Cloud SQL Administration API", "description": "API for Cloud SQL database instance management.", "ownerDomain": "google.com", diff --git a/etc/api/sqladmin/v1beta4/sqladmin-api.json b/etc/api/sqladmin/v1beta4/sqladmin-api.json index 38c3afff4c..e3d62d91ca 100644 --- a/etc/api/sqladmin/v1beta4/sqladmin-api.json +++ b/etc/api/sqladmin/v1beta4/sqladmin-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/5soduF8PrPVjL_-niuaFSHDnPoQ\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/tWiKG-tAYUfQIEzSxsK_muuAjks\"", "discoveryVersion": "v1", "id": "sqladmin:v1beta4", "name": "sqladmin", "canonicalName": "SQL Admin", "version": "v1beta4", - "revision": "20150330", + "revision": "20150305", "title": "Cloud SQL Administration API", "description": "API for Cloud SQL database instance management.", "ownerDomain": "google.com", diff --git a/etc/api/storage/v1/storage-api.json b/etc/api/storage/v1/storage-api.json index 4a1cf52f8b..9cdaee7f06 100644 --- a/etc/api/storage/v1/storage-api.json +++ b/etc/api/storage/v1/storage-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/lTxRjj5-AURGfd9glUYk42wgbOA\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/o6fIbxE4MR_Z46vbs1q1tFmo4DI\"", "discoveryVersion": "v1", "id": "storage:v1", "name": "storage", "version": "v1", - "revision": "20150326", + "revision": "20150710", "title": "Cloud Storage API", "description": "Lets you store and retrieve potentially-large, immutable data objects.", "ownerDomain": "google.com", @@ -569,13 +569,14 @@ "description": "Content-Type of the object data.", "annotations": { "required": [ + "storage.objects.insert", "storage.objects.update" ] } }, "crc32c": { "type": "string", - "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order." + "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices." }, "etag": { "type": "string", @@ -597,7 +598,7 @@ }, "md5Hash": { "type": "string", - "description": "MD5 hash of the data; encoded using base64." + "description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices." }, "mediaLink": { "type": "string", diff --git a/etc/api/storage/v1beta1/storage-api.json b/etc/api/storage/v1beta1/storage-api.json index db891da109..e2504e901a 100644 --- a/etc/api/storage/v1beta1/storage-api.json +++ b/etc/api/storage/v1beta1/storage-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/WQRdzaQ0LWLwTZYnVDjCA40_sPw\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/y_eWUHoJ8dbmnSoSXc2EL0M3dbo\"", "discoveryVersion": "v1", "id": "storage:v1beta1", "name": "storage", "version": "v1beta1", - "revision": "20150326", + "revision": "20150710", "title": "Cloud Storage API", "description": "Lets you store and retrieve potentially-large, immutable data objects.", "ownerDomain": "google.com", diff --git a/etc/api/storage/v1beta2/storage-api.json b/etc/api/storage/v1beta2/storage-api.json index dd6f93f72e..0dcb6c3dec 100644 --- a/etc/api/storage/v1beta2/storage-api.json +++ b/etc/api/storage/v1beta2/storage-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/w3lFgEL0TdXbHNrIBh25Rvn8gok\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/05UP-kVXwMzvJEtAas1m5IU3zdM\"", "discoveryVersion": "v1", "id": "storage:v1beta2", "name": "storage", "version": "v1beta2", - "revision": "20150326", + "revision": "20150710", "title": "Cloud Storage API", "description": "Lets you store and retrieve potentially-large, immutable data objects.", "ownerDomain": "google.com", diff --git a/etc/api/webmasters/v3/webmasters-api.json b/etc/api/webmasters/v3/webmasters-api.json index 1dc73c3903..614d7f57bf 100644 --- a/etc/api/webmasters/v3/webmasters-api.json +++ b/etc/api/webmasters/v3/webmasters-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/sCAxuVQJb4ynjZxsnsm28T2muEw\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/j0enR1Y0uYrSDV6RMbQcmkIwHg4\"", "discoveryVersion": "v1", "id": "webmasters:v3", "name": "webmasters", "version": "v3", - "revision": "20140908", + "revision": "20150624", "title": "Webmaster Tools API", "description": "Lets you view Google Webmaster Tools data for your verified sites.", "ownerDomain": "google.com", @@ -14,7 +14,7 @@ "x16": "https://www.google.com/images/icons/product/webmaster_tools-16.png", "x32": "https://www.google.com/images/icons/product/webmaster_tools-32.png" }, - "documentationLink": "https://developers.google.com/webmaster-tools/v3/welcome", + "documentationLink": "https://developers.google.com/webmaster-tools/", "protocol": "rest", "baseUrl": "https://www.googleapis.com/webmasters/v3/", "basePath": "/webmasters/v3/", @@ -79,6 +79,123 @@ } }, "schemas": { + "ApiDataRow": { + "id": "ApiDataRow", + "type": "object", + "properties": { + "clicks": { + "type": "number", + "format": "double" + }, + "ctr": { + "type": "number", + "format": "double" + }, + "impressions": { + "type": "number", + "format": "double" + }, + "keys": { + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "type": "number", + "format": "double" + } + } + }, + "ApiDimensionFilter": { + "id": "ApiDimensionFilter", + "type": "object", + "properties": { + "dimension": { + "type": "string" + }, + "expression": { + "type": "string" + }, + "operator": { + "type": "string" + } + } + }, + "ApiDimensionFilterGroup": { + "id": "ApiDimensionFilterGroup", + "type": "object", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "ApiDimensionFilter" + } + }, + "groupType": { + "type": "string" + } + } + }, + "SearchAnalyticsQueryRequest": { + "id": "SearchAnalyticsQueryRequest", + "type": "object", + "properties": { + "aggregationType": { + "type": "string", + "description": "[Optional; Default is AUTO] How data is aggregated. If aggregated by property, all data for the same property is aggregated; if aggregated by page, all data is aggregated by canonical URI. If you filter or group by page, choose AUTO; otherwise you can aggregate either by property or by page, depending on how you want your data calculated; see the help documentation to learn how data is calculated differently by site versus by page.\n\nNote: If you group or filter by page, you cannot aggregate by property.\n\nIf you specify any value other than AUTO, the aggregation type in the result will match the requested type, or if you request an invalid type, you will get an error. The API will never change your aggregation type if the requested type is invalid." + }, + "dimensionFilterGroups": { + "type": "array", + "description": "[Optional] Zero or more filters to apply to the dimension grouping values; for example, 'Country CONTAINS \"Guinea\"' to see only data where the country contains the substring \"Guinea\". You can filter by a dimension without grouping by it.", + "items": { + "$ref": "ApiDimensionFilterGroup" + } + }, + "dimensions": { + "type": "array", + "description": "[Optional] Zero or more dimensions to group results by. Dimensions are the group-by values in the Search Analytics page. Dimensions are combined to create a unique row key for each row. Results are grouped in the order that you supply these dimensions.", + "items": { + "type": "string" + } + }, + "endDate": { + "type": "string", + "description": "[Required] End date of the requested date range, in YYYY-MM-DD format, in PST (UTC - 8:00). Must be greater than or equal to the start date. This value is included in the range." + }, + "rowLimit": { + "type": "integer", + "description": "[Optional; Default is 1000] The maximum number of rows to return. Must be a number from 1 to 1,000 (inclusive).", + "format": "int32" + }, + "searchType": { + "type": "string", + "description": "[Optional; Default is WEB] The search type to filter for." + }, + "startDate": { + "type": "string", + "description": "[Required] Start date of the requested date range, in YYYY-MM-DD format, in PST time (UTC - 8:00). Must be less than or equal to the end date. This value is included in the range." + } + } + }, + "SearchAnalyticsQueryResponse": { + "id": "SearchAnalyticsQueryResponse", + "type": "object", + "description": "A list of rows, one per result, grouped by key. Metrics in each row are aggregated for all data grouped by that key either by page or property, as specified by the aggregation type parameter.", + "properties": { + "responseAggregationType": { + "type": "string", + "description": "How the results were aggregated." + }, + "rows": { + "type": "array", + "description": "A list of rows grouped by the key values in the order given in the query.", + "items": { + "$ref": "ApiDataRow" + } + } + } + }, "SitemapsListResponse": { "id": "SitemapsListResponse", "type": "object", @@ -86,7 +203,7 @@ "properties": { "sitemap": { "type": "array", - "description": "Information about a sitemap entry.", + "description": "Contains detailed information about a specific URL submitted as a sitemap.", "items": { "$ref": "WmxSitemap" } @@ -100,7 +217,7 @@ "properties": { "siteEntry": { "type": "array", - "description": "Access level information for a Webmaster Tools site.", + "description": "Contains permission level information about a Webmaster Tools site. For more information, see Permissions in Webmaster Tools.", "items": { "$ref": "WmxSite" } @@ -119,7 +236,7 @@ }, "timestamp": { "type": "string", - "description": "The time (well, date) when errors were detected, in RFC 3339 format.", + "description": "The date and time when the crawl attempt took place, in RFC 3339 format.", "format": "date-time" } } @@ -142,7 +259,7 @@ }, "platform": { "type": "string", - "description": "Corresponding to the user agent that made the request." + "description": "The general type of Googlebot that made the request (see list of Googlebot user-agents for the user-agents used)." } } }, @@ -153,7 +270,7 @@ "properties": { "countPerTypes": { "type": "array", - "description": "The time series of the number of URL crawl errors for per error category and platform.", + "description": "The time series of the number of URL crawl errors per error category and platform.", "items": { "$ref": "UrlCrawlErrorCountsPerType" } @@ -163,6 +280,7 @@ "UrlCrawlErrorsSample": { "id": "UrlCrawlErrorsSample", "type": "object", + "description": "Contains information about specific crawl errors.", "properties": { "first_detected": { "type": "string", @@ -227,7 +345,7 @@ "WmxSite": { "id": "WmxSite", "type": "object", - "description": "Access level information for a Webmaster Tools site.", + "description": "Contains permission level information about a Webmaster Tools site. For more information, see Permissions in Webmaster Tools.", "properties": { "permissionLevel": { "type": "string", @@ -242,6 +360,7 @@ "WmxSitemap": { "id": "WmxSitemap", "type": "object", + "description": "Contains detailed information about a specific URL submitted as a sitemap.", "properties": { "contents": { "type": "array", @@ -252,7 +371,7 @@ }, "errors": { "type": "string", - "description": "Number of errors in the sitemap - issues with the sitemap itself, that needs to be fixed before it can be processed correctly.", + "description": "Number of errors in the sitemap. These are issues with the sitemap itself that need to be fixed before it can be processed correctly.", "format": "int64" }, "isPending": { @@ -279,11 +398,11 @@ }, "type": { "type": "string", - "description": "The type of the sitemap (for example \"sitemap\")." + "description": "The type of the sitemap. For example: rssFeed." }, "warnings": { "type": "string", - "description": "Number of warnings for the sitemap - issues with URLs in the sitemaps.", + "description": "Number of warnings for the sitemap. These are generally non-critical issues with URLs in the sitemaps.", "format": "int64" } } @@ -305,12 +424,43 @@ }, "type": { "type": "string", - "description": "The specific type of content in this sitemap (for example \"web\", \"images\")." + "description": "The specific type of content in this sitemap. For example: web." } } } }, "resources": { + "searchanalytics": { + "methods": { + "query": { + "id": "webmasters.searchanalytics.query", + "path": "sites/{siteUrl}/searchAnalytics/query", + "httpMethod": "POST", + "description": "[LIMITED ACCESS]\n\nQuery your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days.\n\nWhen date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned.", + "parameters": { + "siteUrl": { + "type": "string", + "description": "The site's URL, including protocol. For example: http://www.example.com/", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "siteUrl" + ], + "request": { + "$ref": "SearchAnalyticsQueryRequest" + }, + "response": { + "$ref": "SearchAnalyticsQueryResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/webmasters", + "https://www.googleapis.com/auth/webmasters.readonly" + ] + } + } + }, "sitemaps": { "methods": { "delete": { @@ -321,13 +471,13 @@ "parameters": { "feedpath": { "type": "string", - "description": "The URL of the actual sitemap (for example http://www.example.com/sitemap.xml).", + "description": "The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml", "required": true, "location": "path" }, "siteUrl": { "type": "string", - "description": "The site's URL, including protocol, for example 'http://www.example.com/'", + "description": "The site's URL, including protocol. For example: http://www.example.com/", "required": true, "location": "path" } @@ -348,13 +498,13 @@ "parameters": { "feedpath": { "type": "string", - "description": "The URL of the actual sitemap (for example http://www.example.com/sitemap.xml).", + "description": "The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml", "required": true, "location": "path" }, "siteUrl": { "type": "string", - "description": "The site's URL, including protocol, for example 'http://www.example.com/'", + "description": "The site's URL, including protocol. For example: http://www.example.com/", "required": true, "location": "path" } @@ -375,17 +525,17 @@ "id": "webmasters.sitemaps.list", "path": "sites/{siteUrl}/sitemaps", "httpMethod": "GET", - "description": "Lists sitemaps uploaded to the site.", + "description": "Lists the sitemaps-entries submitted for this site, or included in the sitemap index file (if sitemapIndex is specified in the request).", "parameters": { "siteUrl": { "type": "string", - "description": "The site's URL, including protocol, for example 'http://www.example.com/'", + "description": "The site's URL, including protocol. For example: http://www.example.com/", "required": true, "location": "path" }, "sitemapIndex": { "type": "string", - "description": "A URL of a site's sitemap index.", + "description": "A URL of a site's sitemap index. For example: http://www.example.com/sitemapindex.xml", "location": "query" } }, @@ -408,13 +558,13 @@ "parameters": { "feedpath": { "type": "string", - "description": "The URL of the sitemap to add.", + "description": "The URL of the sitemap to add. For example: http://www.example.com/sitemap.xml", "required": true, "location": "path" }, "siteUrl": { "type": "string", - "description": "The site's URL, including protocol, for example 'http://www.example.com/'", + "description": "The site's URL, including protocol. For example: http://www.example.com/", "required": true, "location": "path" } @@ -459,7 +609,7 @@ "parameters": { "siteUrl": { "type": "string", - "description": "The site's URL, including protocol, for example 'http://www.example.com/'", + "description": "The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/", "required": true, "location": "path" } @@ -479,7 +629,7 @@ "parameters": { "siteUrl": { "type": "string", - "description": "The site's URL, including protocol, for example 'http://www.example.com/'", + "description": "The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/", "required": true, "location": "path" } @@ -499,7 +649,7 @@ "id": "webmasters.sites.list", "path": "sites", "httpMethod": "GET", - "description": "Lists your Webmaster Tools sites.", + "description": "Lists the user's Webmaster Tools sites.", "response": { "$ref": "SitesListResponse" }, @@ -520,7 +670,7 @@ "parameters": { "category": { "type": "string", - "description": "The crawl error category, for example 'serverError'. If not specified, we return results for all categories.", + "description": "The crawl error category. For example: serverError. If not specified, returns results for all categories.", "enum": [ "authPermissions", "manyToOneRedirect", @@ -551,7 +701,7 @@ }, "platform": { "type": "string", - "description": "The user agent type (platform) that made the request, for example 'web'. If not specified, we return results for all platforms.", + "description": "The user agent type (platform) that made the request. For example: web. If not specified, returns results for all platforms.", "enum": [ "mobile", "smartphoneOnly", @@ -566,7 +716,7 @@ }, "siteUrl": { "type": "string", - "description": "The site's URL, including protocol, for example 'http://www.example.com/'", + "description": "The site's URL, including protocol. For example: http://www.example.com/", "required": true, "location": "path" } @@ -594,7 +744,7 @@ "parameters": { "category": { "type": "string", - "description": "The crawl error category, for example 'authPermissions'", + "description": "The crawl error category. For example: authPermissions", "required": true, "enum": [ "authPermissions", @@ -620,7 +770,7 @@ }, "platform": { "type": "string", - "description": "The user agent type (platform) that made the request, for example 'web'", + "description": "The user agent type (platform) that made the request. For example: web", "required": true, "enum": [ "mobile", @@ -636,13 +786,13 @@ }, "siteUrl": { "type": "string", - "description": "The site's URL, including protocol, for example 'http://www.example.com/'", + "description": "The site's URL, including protocol. For example: http://www.example.com/", "required": true, "location": "path" }, "url": { "type": "string", - "description": "The relative path (without the site) of the sample URL; must be one of the URLs returned by list", + "description": "The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename", "required": true, "location": "path" } @@ -669,7 +819,7 @@ "parameters": { "category": { "type": "string", - "description": "The crawl error category, for example 'authPermissions'", + "description": "The crawl error category. For example: authPermissions", "required": true, "enum": [ "authPermissions", @@ -695,7 +845,7 @@ }, "platform": { "type": "string", - "description": "The user agent type (platform) that made the request, for example 'web'", + "description": "The user agent type (platform) that made the request. For example: web", "required": true, "enum": [ "mobile", @@ -711,7 +861,7 @@ }, "siteUrl": { "type": "string", - "description": "The site's URL, including protocol, for example 'http://www.example.com/'", + "description": "The site's URL, including protocol. For example: http://www.example.com/", "required": true, "location": "path" } @@ -737,7 +887,7 @@ "parameters": { "category": { "type": "string", - "description": "The crawl error category, for example 'authPermissions'", + "description": "The crawl error category. For example: authPermissions", "required": true, "enum": [ "authPermissions", @@ -763,7 +913,7 @@ }, "platform": { "type": "string", - "description": "The user agent type (platform) that made the request, for example 'web'", + "description": "The user agent type (platform) that made the request. For example: web", "required": true, "enum": [ "mobile", @@ -779,13 +929,13 @@ }, "siteUrl": { "type": "string", - "description": "The site's URL, including protocol, for example 'http://www.example.com/'", + "description": "The site's URL, including protocol. For example: http://www.example.com/", "required": true, "location": "path" }, "url": { "type": "string", - "description": "The relative path (without the site) of the sample URL; must be one of the URLs returned by list", + "description": "The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename", "required": true, "location": "path" } diff --git a/etc/api/youtube/v3/youtube-api.json b/etc/api/youtube/v3/youtube-api.json index 778f250466..062202a50f 100644 --- a/etc/api/youtube/v3/youtube-api.json +++ b/etc/api/youtube/v3/youtube-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Ru_OFZL_9JBTrnQ2wlhRmAO3y_k\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/dDzLANLY4y_3rdEpUNli-dPof40\"", "discoveryVersion": "v1", "id": "youtube:v3", "name": "youtube", "canonicalName": "YouTube", "version": "v3", - "revision": "20150529", + "revision": "20150706", "title": "YouTube Data API", "description": "Programmatic access to YouTube features.", "ownerDomain": "google.com", @@ -2503,6 +2503,9 @@ "type": "string", "description": "Rating system for Indonesia - Lembaga Sensor Film", "enum": [ + "lsf13", + "lsf17", + "lsf21", "lsfA", "lsfBo", "lsfD", @@ -2516,6 +2519,9 @@ "", "", "", + "", + "", + "", "" ] }, @@ -4000,25 +4006,25 @@ "type": "string", "description": "The kind of error happening.", "enum": [ - "audioBitrate", "audioBitrateHigh", "audioBitrateLow", + "audioBitrateMismatch", "audioCodec", "audioCodecMismatch", "audioSampleRate", "audioSampleRateMismatch", "audioStereoMismatch", - "audioTooManyChannel", + "audioTooManyChannels", "badContainer", "bitrateHigh", "bitrateLow", - "framerateHigh", + "frameRateHigh", "framerateMismatch", "gopMismatch", "gopSizeLong", "gopSizeOver", "gopSizeShort", - "interlaceVideo", + "interlacedVideo", "multipleAudioStreams", "multipleVideoStreams", "noAudioStream", @@ -4098,7 +4104,7 @@ "$ref": "LiveStreamConfigurationIssue" } }, - "lastUpdateTimeS": { + "lastUpdateTimeSeconds": { "type": "string", "description": "The last time this status was updated (in seconds)", "format": "uint64" @@ -7628,6 +7634,52 @@ "https://www.googleapis.com/auth/youtube.force-ssl" ] }, + "bind_direct": { + "id": "youtube.liveBroadcasts.bind_direct", + "path": "liveBroadcasts/bind/direct", + "httpMethod": "POST", + "description": "Binds a YouTube broadcast to a stream or removes an existing binding between a broadcast and a stream. A broadcast can only be bound to one video stream, though a video stream may be bound to more than one broadcast.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the unique ID of the broadcast that is being bound to a video stream.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.", + "required": true, + "location": "query" + }, + "streamId": { + "type": "string", + "description": "The streamId parameter specifies the unique ID of the video stream that is being bound to a broadcast. If this parameter is omitted, the API will remove any existing binding between the broadcast and a video stream.", + "location": "query" + } + }, + "parameterOrder": [ + "id", + "part" + ], + "response": { + "$ref": "LiveBroadcast" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, "control": { "id": "youtube.liveBroadcasts.control", "path": "liveBroadcasts/control", diff --git a/etc/api/youtubeanalytics/v1/youtubeanalytics-api.json b/etc/api/youtubeanalytics/v1/youtubeanalytics-api.json index 5913f52b1e..0f25e62c57 100644 --- a/etc/api/youtubeanalytics/v1/youtubeanalytics-api.json +++ b/etc/api/youtubeanalytics/v1/youtubeanalytics-api.json @@ -1,6 +1,6 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/lfXuvexGjLWvv2bGYOX_MVmrKM4\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/C3vQT4j_3dhMyf8QNzNOBvuZRuQ\"", "discoveryVersion": "v1", "id": "youtubeAnalytics:v1", "name": "youtubeAnalytics", @@ -82,7 +82,7 @@ "description": "View and manage your assets and associated content on YouTube" }, "https://www.googleapis.com/auth/yt-analytics-monetary.readonly": { - "description": "View YouTube Analytics monetary reports for your YouTube content" + "description": "View monetary and non-monetary YouTube Analytics reports for your YouTube content" }, "https://www.googleapis.com/auth/yt-analytics.readonly": { "description": "View YouTube Analytics reports for your YouTube content" diff --git a/etc/api/youtubeanalytics/v1beta1/youtubeanalytics-api.json b/etc/api/youtubeanalytics/v1beta1/youtubeanalytics-api.json index e79008b7f8..66c3c031c8 100644 --- a/etc/api/youtubeanalytics/v1beta1/youtubeanalytics-api.json +++ b/etc/api/youtubeanalytics/v1beta1/youtubeanalytics-api.json @@ -1,6 +1,6 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ID2nf7n7eRyIPf4mFz5QF1inEVE\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/wzHkxHWEX9PcW7ZnULAilfkQsbM\"", "discoveryVersion": "v1", "id": "youtubeAnalytics:v1beta1", "name": "youtubeAnalytics", @@ -85,7 +85,7 @@ "description": "View and manage your assets and associated content on YouTube" }, "https://www.googleapis.com/auth/yt-analytics-monetary.readonly": { - "description": "View YouTube Analytics monetary reports for your YouTube content" + "description": "View monetary and non-monetary YouTube Analytics reports for your YouTube content" }, "https://www.googleapis.com/auth/yt-analytics.readonly": { "description": "View YouTube Analytics reports for your YouTube content" diff --git a/gen/genomics1-cli/Cargo.toml b/gen/genomics1-cli/Cargo.toml index cc5eaf8e5e..0d1ea05e76 100644 --- a/gen/genomics1-cli/Cargo.toml +++ b/gen/genomics1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-genomics1-cli" -version = "0.3.0+20150615" +version = "0.3.1+20150716" authors = ["Sebastian Thiel "] description = "A complete library to interact with genomics (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/genomics1-cli" @@ -16,13 +16,13 @@ keywords = ["genomics", "google", "cli"] name = "genomics1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.4" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" -clap = ">= 0.9.1" +clap = ">= 1.0.3" [build-dependencies] syntex = { version = "*" } diff --git a/gen/genomics1-cli/README.md b/gen/genomics1-cli/README.md index f699748a88..e1d1bad14f 100644 --- a/gen/genomics1-cli/README.md +++ b/gen/genomics1-cli/README.md @@ -14,20 +14,74 @@ If data-structures are requested, these will be returned as pretty-printed JSON, You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.0/ubuntu/genomics1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.0/osx/genomics1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/genomics1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/genomics1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/genomics1-cli). # Usage -This documentation was generated from the *genomics* API at revision *20150615*. The CLI is at version *0.3.0*. +This documentation was generated from the *genomics* API at revision *20150716*. The CLI is at version *0.3.1*. ```bash genomics1 [options] + callsets + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + search (-r )... [-p ]... [-o ] + datasets + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + undelete (-r )... [-p ]... [-o ] + operations + cancel (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + list [-p ]... [-o ] + readgroupsets + coveragebuckets-list [-p ]... [-o ] + delete [-p ]... [-o ] + export (-r )... [-p ]... [-o ] + get [-p ]... [-o ] + import (-r )... [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + search (-r )... [-p ]... [-o ] + reads + search (-r )... [-p ]... [-o ] + references + bases-list [-p ]... [-o ] + get [-p ]... [-o ] + search (-r )... [-p ]... [-o ] + referencesets + get [-p ]... [-o ] + search (-r )... [-p ]... [-o ] + variants + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + import (-r )... [-p ]... [-o ] + merge (-r )... [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + search (-r )... [-p ]... [-o ] + variantsets + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + export (-r )... [-p ]... [-o ] + get [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + search (-r )... [-p ]... [-o ] genomics1 --help Configuration: + [--scope ]... + Specify the authentication a method should be executed in. Each scope + requires the user to grant this application permission to use it. + If unset, it defaults to the shortest scope url for a particular method. --config-dir A directory into which we will store our persistent data. Defaults to a user-writable directory that we will create during the first invocation. diff --git a/gen/genomics1-cli/mkdocs.yml b/gen/genomics1-cli/mkdocs.yml index b37d5e4ec1..c09ee09738 100644 --- a/gen/genomics1-cli/mkdocs.yml +++ b/gen/genomics1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: genomics v0.3.0+20150615 +site_name: genomics v0.3.1+20150716 site_url: http://byron.github.io/google-apis-rs/google-genomics1-cli site_description: Write integrating applications with bcore @@ -9,6 +9,47 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['callsets_create.md', 'Callsets', 'Create'] +- ['callsets_delete.md', 'Callsets', 'Delete'] +- ['callsets_get.md', 'Callsets', 'Get'] +- ['callsets_patch.md', 'Callsets', 'Patch'] +- ['callsets_search.md', 'Callsets', 'Search'] +- ['datasets_create.md', 'Datasets', 'Create'] +- ['datasets_delete.md', 'Datasets', 'Delete'] +- ['datasets_get.md', 'Datasets', 'Get'] +- ['datasets_list.md', 'Datasets', 'List'] +- ['datasets_patch.md', 'Datasets', 'Patch'] +- ['datasets_undelete.md', 'Datasets', 'Undelete'] +- ['operations_cancel.md', 'Operations', 'Cancel'] +- ['operations_delete.md', 'Operations', 'Delete'] +- ['operations_get.md', 'Operations', 'Get'] +- ['operations_list.md', 'Operations', 'List'] +- ['readgroupsets_coveragebuckets-list.md', 'Readgroupsets', 'Coveragebuckets List'] +- ['readgroupsets_delete.md', 'Readgroupsets', 'Delete'] +- ['readgroupsets_export.md', 'Readgroupsets', 'Export'] +- ['readgroupsets_get.md', 'Readgroupsets', 'Get'] +- ['readgroupsets_import.md', 'Readgroupsets', 'Import'] +- ['readgroupsets_patch.md', 'Readgroupsets', 'Patch'] +- ['readgroupsets_search.md', 'Readgroupsets', 'Search'] +- ['reads_search.md', 'Reads', 'Search'] +- ['references_bases-list.md', 'References', 'Bases List'] +- ['references_get.md', 'References', 'Get'] +- ['references_search.md', 'References', 'Search'] +- ['referencesets_get.md', 'Referencesets', 'Get'] +- ['referencesets_search.md', 'Referencesets', 'Search'] +- ['variants_create.md', 'Variants', 'Create'] +- ['variants_delete.md', 'Variants', 'Delete'] +- ['variants_get.md', 'Variants', 'Get'] +- ['variants_import.md', 'Variants', 'Import'] +- ['variants_merge.md', 'Variants', 'Merge'] +- ['variants_patch.md', 'Variants', 'Patch'] +- ['variants_search.md', 'Variants', 'Search'] +- ['variantsets_create.md', 'Variantsets', 'Create'] +- ['variantsets_delete.md', 'Variantsets', 'Delete'] +- ['variantsets_export.md', 'Variantsets', 'Export'] +- ['variantsets_get.md', 'Variantsets', 'Get'] +- ['variantsets_patch.md', 'Variantsets', 'Patch'] +- ['variantsets_search.md', 'Variantsets', 'Search'] theme: readthedocs diff --git a/gen/genomics1-cli/src/main.rs b/gen/genomics1-cli/src/main.rs index 0852020f4b..9f47f24c84 100644 --- a/gen/genomics1-cli/src/main.rs +++ b/gen/genomics1-cli/src/main.rs @@ -44,11 +44,3249 @@ struct Engine<'n, 'a> { impl<'n, 'a> Engine<'n, 'a> { + fn _callsets_create(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "sample-id" => Some(("sampleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variant-set-ids" => Some(("variantSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "created" => Some(("created", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["created", "id", "name", "sample-id", "variant-set-ids"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CallSet = json::value::from_value(object).unwrap(); + let mut call = self.hub.callsets().create(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _callsets_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.callsets().delete(opt.value_of("call-set-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _callsets_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.callsets().get(opt.value_of("call-set-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _callsets_patch(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "sample-id" => Some(("sampleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variant-set-ids" => Some(("variantSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "created" => Some(("created", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["created", "id", "name", "sample-id", "variant-set-ids"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CallSet = json::value::from_value(object).unwrap(); + let mut call = self.hub.callsets().patch(request, opt.value_of("call-set-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _callsets_search(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variant-set-ids" => Some(("variantSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["name", "page-size", "page-token", "variant-set-ids"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SearchCallSetsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.callsets().search(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _datasets_create(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "id", "name", "project-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Dataset = json::value::from_value(object).unwrap(); + let mut call = self.hub.datasets().create(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _datasets_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.datasets().delete(opt.value_of("dataset-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _datasets_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.datasets().get(opt.value_of("dataset-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _datasets_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.datasets().list(); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "project-id" => { + call = call.project_id(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["project-id", "page-size", "page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _datasets_patch(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "id", "name", "project-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Dataset = json::value::from_value(object).unwrap(); + let mut call = self.hub.datasets().patch(request, opt.value_of("dataset-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _datasets_undelete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UndeleteDatasetRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.datasets().undelete(request, opt.value_of("dataset-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _operations_cancel(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CancelOperationRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.operations().cancel(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _operations_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.operations().delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _operations_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.operations().get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _operations_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.operations().list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _readgroupsets_coveragebuckets_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.readgroupsets().coveragebuckets_list(opt.value_of("read-group-set-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "target-bucket-width" => { + call = call.target_bucket_width(value.unwrap_or("")); + }, + "start" => { + call = call.start(value.unwrap_or("")); + }, + "reference-name" => { + call = call.reference_name(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "end" => { + call = call.end(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["end", "page-size", "page-token", "start", "target-bucket-width", "reference-name"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _readgroupsets_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.readgroupsets().delete(opt.value_of("read-group-set-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _readgroupsets_export(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-names" => Some(("referenceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "export-uri" => Some(("exportUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["export-uri", "project-id", "reference-names"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ExportReadGroupSetRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.readgroupsets().export(request, opt.value_of("read-group-set-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _readgroupsets_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.readgroupsets().get(opt.value_of("read-group-set-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _readgroupsets_import(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "source-uris" => Some(("sourceUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "partition-strategy" => Some(("partitionStrategy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["dataset-id", "partition-strategy", "reference-set-id", "source-uris"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ImportReadGroupSetsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.readgroupsets().import(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _readgroupsets_patch(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "filename" => Some(("filename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["dataset-id", "filename", "id", "name", "reference-set-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ReadGroupSet = json::value::from_value(object).unwrap(); + let mut call = self.hub.readgroupsets().patch(request, opt.value_of("read-group-set-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _readgroupsets_search(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dataset-ids" => Some(("datasetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["dataset-ids", "name", "page-size", "page-token"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SearchReadGroupSetsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.readgroupsets().search(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _reads_search(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "end" => Some(("end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "read-group-ids" => Some(("readGroupIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start" => Some(("start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "read-group-set-ids" => Some(("readGroupSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["end", "page-size", "page-token", "read-group-ids", "read-group-set-ids", "reference-name", "start"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SearchReadsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.reads().search(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _references_bases_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.references().bases_list(opt.value_of("reference-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "start" => { + call = call.start(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "end" => { + call = call.end(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["start", "end", "page-size", "page-token"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _references_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.references().get(opt.value_of("reference-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _references_search(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "md5checksums" => Some(("md5checksums", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "accessions" => Some(("accessions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["accessions", "md5checksums", "page-size", "page-token", "reference-set-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SearchReferencesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.references().search(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _referencesets_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.referencesets().get(opt.value_of("reference-set-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _referencesets_search(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "md5checksums" => Some(("md5checksums", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "assembly-id" => Some(("assemblyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "accessions" => Some(("accessions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["accessions", "assembly-id", "md5checksums", "page-size", "page-token"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SearchReferenceSetsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.referencesets().search(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _variants_create(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "variant-set-id" => Some(("variantSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end" => Some(("end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "created" => Some(("created", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-bases" => Some(("referenceBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "start" => Some(("start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "names" => Some(("names", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "alternate-bases" => Some(("alternateBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "quality" => Some(("quality", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-bases", "created", "end", "filter", "id", "names", "quality", "reference-bases", "reference-name", "start", "variant-set-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Variant = json::value::from_value(object).unwrap(); + let mut call = self.hub.variants().create(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _variants_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.variants().delete(opt.value_of("variant-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _variants_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.variants().get(opt.value_of("variant-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _variants_import(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "variant-set-id" => Some(("variantSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "normalize-reference-names" => Some(("normalizeReferenceNames", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "source-uris" => Some(("sourceUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["format", "normalize-reference-names", "source-uris", "variant-set-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ImportVariantsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.variants().import(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _variants_merge(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "variant-set-id" => Some(("variantSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["variant-set-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::MergeVariantsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.variants().merge(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _variants_patch(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "variant-set-id" => Some(("variantSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end" => Some(("end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "created" => Some(("created", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-bases" => Some(("referenceBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "start" => Some(("start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "names" => Some(("names", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "alternate-bases" => Some(("alternateBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "quality" => Some(("quality", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-bases", "created", "end", "filter", "id", "names", "quality", "reference-bases", "reference-name", "start", "variant-set-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Variant = json::value::from_value(object).unwrap(); + let mut call = self.hub.variants().patch(request, opt.value_of("variant-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _variants_search(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "end" => Some(("end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "start" => Some(("start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "max-calls" => Some(("maxCalls", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "call-set-ids" => Some(("callSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "variant-name" => Some(("variantName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "variant-set-ids" => Some(("variantSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["call-set-ids", "end", "max-calls", "page-size", "page-token", "reference-name", "start", "variant-name", "variant-set-ids"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SearchVariantsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.variants().search(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _variantsets_create(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["dataset-id", "id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::VariantSet = json::value::from_value(object).unwrap(); + let mut call = self.hub.variantsets().create(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _variantsets_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.variantsets().delete(opt.value_of("variant-set-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _variantsets_export(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-table" => Some(("bigqueryTable", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-dataset" => Some(("bigqueryDataset", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "call-set-ids" => Some(("callSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-dataset", "bigquery-table", "call-set-ids", "format", "project-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ExportVariantSetRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.variantsets().export(request, opt.value_of("variant-set-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _variantsets_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.variantsets().get(opt.value_of("variant-set-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _variantsets_patch(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["dataset-id", "id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::VariantSet = json::value::from_value(object).unwrap(); + let mut call = self.hub.variantsets().patch(request, opt.value_of("variant-set-id").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _variantsets_search(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dataset-ids" => Some(("datasetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["dataset-ids", "page-size", "page-token"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SearchVariantSetsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.variantsets().search(request); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _doit(&self, dry_run: bool) -> Result, Option> { let mut err = InvalidOptionsError::new(); let mut call_result: Result<(), DoitError> = Ok(()); let mut err_opt: Option = None; match self.opt.subcommand() { + ("callsets", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._callsets_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._callsets_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._callsets_get(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._callsets_patch(opt, dry_run, &mut err); + }, + ("search", Some(opt)) => { + call_result = self._callsets_search(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("callsets".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("datasets", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._datasets_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._datasets_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._datasets_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._datasets_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._datasets_patch(opt, dry_run, &mut err); + }, + ("undelete", Some(opt)) => { + call_result = self._datasets_undelete(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("datasets".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("operations", Some(opt)) => { + match opt.subcommand() { + ("cancel", Some(opt)) => { + call_result = self._operations_cancel(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._operations_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._operations_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._operations_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("operations".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("readgroupsets", Some(opt)) => { + match opt.subcommand() { + ("coveragebuckets-list", Some(opt)) => { + call_result = self._readgroupsets_coveragebuckets_list(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._readgroupsets_delete(opt, dry_run, &mut err); + }, + ("export", Some(opt)) => { + call_result = self._readgroupsets_export(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._readgroupsets_get(opt, dry_run, &mut err); + }, + ("import", Some(opt)) => { + call_result = self._readgroupsets_import(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._readgroupsets_patch(opt, dry_run, &mut err); + }, + ("search", Some(opt)) => { + call_result = self._readgroupsets_search(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("readgroupsets".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("reads", Some(opt)) => { + match opt.subcommand() { + ("search", Some(opt)) => { + call_result = self._reads_search(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("reads".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("references", Some(opt)) => { + match opt.subcommand() { + ("bases-list", Some(opt)) => { + call_result = self._references_bases_list(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._references_get(opt, dry_run, &mut err); + }, + ("search", Some(opt)) => { + call_result = self._references_search(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("references".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("referencesets", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._referencesets_get(opt, dry_run, &mut err); + }, + ("search", Some(opt)) => { + call_result = self._referencesets_search(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("referencesets".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("variants", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._variants_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._variants_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._variants_get(opt, dry_run, &mut err); + }, + ("import", Some(opt)) => { + call_result = self._variants_import(opt, dry_run, &mut err); + }, + ("merge", Some(opt)) => { + call_result = self._variants_merge(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._variants_patch(opt, dry_run, &mut err); + }, + ("search", Some(opt)) => { + call_result = self._variants_search(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("variants".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("variantsets", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._variantsets_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._variantsets_delete(opt, dry_run, &mut err); + }, + ("export", Some(opt)) => { + call_result = self._variantsets_export(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._variantsets_get(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._variantsets_patch(opt, dry_run, &mut err); + }, + ("search", Some(opt)) => { + call_result = self._variantsets_search(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("variantsets".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, _ => { err.issues.push(CLIError::MissingCommandError); writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); @@ -83,7 +3321,7 @@ impl<'n, 'a> Engine<'n, 'a> { let auth = Authenticator::new( &secret, DefaultAuthenticatorDelegate, if opt.is_present("debug-auth") { hyper::Client::with_connector(mock::TeeConnector { - connector: hyper::net::HttpConnector(None) + connector: hyper::net::HttpsConnector::::default() }) } else { hyper::Client::new() @@ -96,7 +3334,7 @@ impl<'n, 'a> Engine<'n, 'a> { let client = if opt.is_present("debug") { hyper::Client::with_connector(mock::TeeConnector { - connector: hyper::net::HttpConnector(None) + connector: hyper::net::HttpsConnector::::default() }) } else { hyper::Client::new() @@ -135,13 +3373,995 @@ impl<'n, 'a> Engine<'n, 'a> { fn main() { let mut exit_status = 0i32; let arg_data = [ + ("callsets", "methods: 'create', 'delete', 'get', 'patch' and 'search'", vec![ + ("create", + Some(r##"Creates a new call set."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/callsets_create", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes a call set."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/callsets_delete", + vec![ + (Some(r##"call-set-id"##), + None, + Some(r##"The ID of the call set to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Gets a call set by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/callsets_get", + vec![ + (Some(r##"call-set-id"##), + None, + Some(r##"The ID of the call set."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Updates a call set. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/callsets_patch", + vec![ + (Some(r##"call-set-id"##), + None, + Some(r##"The ID of the call set to be updated."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("search", + Some(r##"Gets a list of call sets matching the criteria. Implements [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178)."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/callsets_search", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("datasets", "methods: 'create', 'delete', 'get', 'list', 'patch' and 'undelete'", vec![ + ("create", + Some(r##"Creates a new dataset."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_create", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes a dataset."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_delete", + vec![ + (Some(r##"dataset-id"##), + None, + Some(r##"The ID of the dataset to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Gets a dataset by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_get", + vec![ + (Some(r##"dataset-id"##), + None, + Some(r##"The ID of the dataset."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Lists datasets within a project."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_list", + vec![ + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Updates a dataset. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_patch", + vec![ + (Some(r##"dataset-id"##), + None, + Some(r##"The ID of the dataset to be updated."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("undelete", + Some(r##"Undeletes a dataset by restoring a dataset which was deleted via this API. This operation is only possible for a week after the deletion occurred."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_undelete", + vec![ + (Some(r##"dataset-id"##), + None, + Some(r##"The ID of the dataset to be undeleted."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("operations", "methods: 'cancel', 'delete', 'get' and 'list'", vec![ + ("cancel", + Some(r##"Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use [Operations.GetOperation][google.longrunning.Operations.GetOperation] or [Operations.ListOperations][google.longrunning.Operations.ListOperations] to check whether the cancellation succeeded or the operation completed despite cancellation."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/operations_cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"This method is not implemented. To cancel an operation, please use [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/operations_delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/operations_get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Lists operations that match the specified filter in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/operations_list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation collection."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("readgroupsets", "methods: 'coveragebuckets-list', 'delete', 'export', 'get', 'import', 'patch' and 'search'", vec![ + ("coveragebuckets-list", + Some(r##"Lists fixed width coverage buckets for a read group set, each of which correspond to a range of a reference sequence. Each bucket summarizes coverage information across its corresponding genomic range. Coverage is defined as the number of reads which are aligned to a given base in the reference sequence. Coverage buckets are available at several precomputed bucket widths, enabling retrieval of various coverage 'zoom levels'. The caller must have READ permissions for the target read group set."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_coveragebuckets-list", + vec![ + (Some(r##"read-group-set-id"##), + None, + Some(r##"Required. The ID of the read group set over which coverage is requested."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes a read group set."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_delete", + vec![ + (Some(r##"read-group-set-id"##), + None, + Some(r##"The ID of the read group set to be deleted. The caller must have WRITE permissions to the dataset associated with this read group set."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("export", + Some(r##"Exports a read group set to a BAM file in Google Cloud Storage. Note that currently there may be some differences between exported BAM files and the original BAM file at the time of import. In particular, comments in the input file header will not be preserved, some custom tags will be converted to strings, and original reference sequence order is not necessarily preserved."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_export", + vec![ + (Some(r##"read-group-set-id"##), + None, + Some(r##"Required. The ID of the read group set to export."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Gets a read group set by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_get", + vec![ + (Some(r##"read-group-set-id"##), + None, + Some(r##"The ID of the read group set."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("import", + Some(r##"Creates read group sets by asynchronously importing the provided information. Note that currently comments in the input file header are **not** imported and some custom tags will be converted to strings, rather than preserving tag types. The caller must have WRITE permissions to the dataset."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_import", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Updates a read group set. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_patch", + vec![ + (Some(r##"read-group-set-id"##), + None, + Some(r##"The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("search", + Some(r##"Searches for read group sets matching the criteria. Implements [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135)."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_search", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("reads", "methods: 'search'", vec![ + ("search", + Some(r##"Gets a list of reads for one or more read group sets. Reads search operates over a genomic coordinate space of reference sequence & position defined over the reference sequences to which the requested read group sets are aligned. If a target positional range is specified, search returns all reads whose alignment to the reference genome overlap the range. A query which specifies only read group set IDs yields all reads in those read group sets, including unmapped reads. All reads returned (including reads on subsequent pages) are ordered by genomic coordinate (reference sequence & position). Reads with equivalent genomic coordinates are returned in a deterministic order. Implements [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85)."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/reads_search", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("references", "methods: 'bases-list', 'get' and 'search'", vec![ + ("bases-list", + Some(r##"Lists the bases in a reference, optionally restricted to a range. Implements [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221)."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/references_bases-list", + vec![ + (Some(r##"reference-id"##), + None, + Some(r##"The ID of the reference."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Gets a reference. Implements [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158)."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/references_get", + vec![ + (Some(r##"reference-id"##), + None, + Some(r##"The ID of the reference."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("search", + Some(r##"Searches for references which match the given criteria. Implements [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146)."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/references_search", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("referencesets", "methods: 'get' and 'search'", vec![ + ("get", + Some(r##"Gets a reference set. Implements [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83)."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/referencesets_get", + vec![ + (Some(r##"reference-set-id"##), + None, + Some(r##"The ID of the reference set."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("search", + Some(r##"Searches for reference sets which match the given criteria. Implements [GlobalAllianceApi.searchReferenceSets](http://ga4gh.org/documentation/api/v0.5.1/ga4gh_api.html#/schema/org.ga4gh.searchReferenceSets)."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/referencesets_search", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("variants", "methods: 'create', 'delete', 'get', 'import', 'merge', 'patch' and 'search'", vec![ + ("create", + Some(r##"Creates a new variant."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_create", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes a variant."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_delete", + vec![ + (Some(r##"variant-id"##), + None, + Some(r##"The ID of the variant to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Gets a variant by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_get", + vec![ + (Some(r##"variant-id"##), + None, + Some(r##"The ID of the variant."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("import", + Some(r##"Creates variant data by asynchronously importing the provided information. The variants for import will be merged with any existing data and each other according to the behavior of mergeVariants. In particular, this means for merged VCF variants that have conflicting INFO fields, some data will be arbitrarily discarded. As a special case, for single-sample VCF files, QUAL and FILTER fields will be moved to the call level; these are sometimes interpreted in a call-specific context. Imported VCF headers are appended to the metadata already in a variant set."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_import", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("merge", + Some(r##"Merges the given variants with existing variants. Each variant will be merged with an existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant, and other fields (such as key/value pairs) are discarded."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_merge", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Updates a variant. This method supports patch semantics. Returns the modified variant without its calls."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_patch", + vec![ + (Some(r##"variant-id"##), + None, + Some(r##"The ID of the variant to be updated."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("search", + Some(r##"Gets a list of variants matching the criteria. Implements [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126)."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_search", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("variantsets", "methods: 'create', 'delete', 'export', 'get', 'patch' and 'search'", vec![ + ("create", + Some(r##"Creates a new variant set."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variantsets_create", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes the contents of a variant set. The variant set object is not deleted."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variantsets_delete", + vec![ + (Some(r##"variant-set-id"##), + None, + Some(r##"The ID of the variant set to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("export", + Some(r##"Exports variant set data to an external destination."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variantsets_export", + vec![ + (Some(r##"variant-set-id"##), + None, + Some(r##"Required. The ID of the variant set that contains variant data which should be exported. The caller must have READ access to this variant set."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Gets a variant set by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variantsets_get", + vec![ + (Some(r##"variant-set-id"##), + None, + Some(r##"Required. The ID of the variant set."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Updates a variant set. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variantsets_patch", + vec![ + (Some(r##"variant-set-id"##), + None, + Some(r##"The ID of the variant to be updated (must already exist)."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("search", + Some(r##"Returns a list of all variant sets matching search criteria. Implements [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49)."##), + "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variantsets_search", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ]; let mut app = App::new("genomics1") .author("Sebastian Thiel ") - .version("0.3.0+20150615") + .version("0.3.1+20150716") .about("An API to store, process, explore, and share DNA sequence reads, reference-based alignments, and variant calls.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_genomics1_cli") + .arg(Arg::with_name("url") + .long("scope") + .help("Specify the authentication a method should be executed in. Each scope requires the user to grant this application permission to use it.If unset, it defaults to the shortest scope url for a particular method.") + .multiple(true) + .takes_value(true)) .arg(Arg::with_name("folder") .long("config-dir") .help("A directory into which we will store our persistent data. Defaults to a user-writable directory that we will create during the first invocation.[default: ~/.google-service-cli") @@ -159,10 +4379,10 @@ fn main() { .takes_value(false)); for &(main_command_name, ref about, ref subcommands) in arg_data.iter() { - let mut mcmd = SubCommand::new(main_command_name).about(about); + let mut mcmd = SubCommand::with_name(main_command_name).about(about); for &(sub_command_name, ref desc, url_info, ref args) in subcommands { - let mut scmd = SubCommand::new(sub_command_name); + let mut scmd = SubCommand::with_name(sub_command_name); if let &Some(desc) = desc { scmd = scmd.about(desc); } @@ -216,7 +4436,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/genomics1/Cargo.toml b/gen/genomics1/Cargo.toml index d25f7fbd73..178f0cf509 100644 --- a/gen/genomics1/Cargo.toml +++ b/gen/genomics1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-genomics1" -version = "0.1.8+20150615" +version = "0.1.8+20150716" authors = ["Sebastian Thiel "] description = "A complete library to interact with genomics (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/genomics1" @@ -15,8 +15,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.4" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/genomics1/README.md b/gen/genomics1/README.md index 82d1219907..76952bb453 100644 --- a/gen/genomics1/README.md +++ b/gen/genomics1/README.md @@ -5,11 +5,29 @@ DO NOT EDIT ! --> The `google-genomics1` library allows access to all features of the *Google genomics* service. -This documentation was generated from *genomics* crate version *0.1.8+20150615*, where *20150615* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *genomics* crate version *0.1.8+20150716*, where *20150716* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. # Features -It seems there is nothing you can do here ... . +Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_genomics1/struct.Genomics.html) ... +* callsets + * [*create*](http://byron.github.io/google-apis-rs/google_genomics1/struct.CallsetCreateCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_genomics1/struct.CallsetDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_genomics1/struct.CallsetGetCall.html), [*patch*](http://byron.github.io/google-apis-rs/google_genomics1/struct.CallsetPatchCall.html) and [*search*](http://byron.github.io/google-apis-rs/google_genomics1/struct.CallsetSearchCall.html) +* [datasets](http://byron.github.io/google-apis-rs/google_genomics1/struct.Dataset.html) + * [*create*](http://byron.github.io/google-apis-rs/google_genomics1/struct.DatasetCreateCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_genomics1/struct.DatasetDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_genomics1/struct.DatasetGetCall.html), [*list*](http://byron.github.io/google-apis-rs/google_genomics1/struct.DatasetListCall.html), [*patch*](http://byron.github.io/google-apis-rs/google_genomics1/struct.DatasetPatchCall.html) and [*undelete*](http://byron.github.io/google-apis-rs/google_genomics1/struct.DatasetUndeleteCall.html) +* [operations](http://byron.github.io/google-apis-rs/google_genomics1/struct.Operation.html) + * [*cancel*](http://byron.github.io/google-apis-rs/google_genomics1/struct.OperationCancelCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_genomics1/struct.OperationDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_genomics1/struct.OperationGetCall.html) and [*list*](http://byron.github.io/google-apis-rs/google_genomics1/struct.OperationListCall.html) +* readgroupsets + * [*coveragebuckets list*](http://byron.github.io/google-apis-rs/google_genomics1/struct.ReadgroupsetCoveragebucketListCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_genomics1/struct.ReadgroupsetDeleteCall.html), [*export*](http://byron.github.io/google-apis-rs/google_genomics1/struct.ReadgroupsetExportCall.html), [*get*](http://byron.github.io/google-apis-rs/google_genomics1/struct.ReadgroupsetGetCall.html), [*import*](http://byron.github.io/google-apis-rs/google_genomics1/struct.ReadgroupsetImportCall.html), [*patch*](http://byron.github.io/google-apis-rs/google_genomics1/struct.ReadgroupsetPatchCall.html) and [*search*](http://byron.github.io/google-apis-rs/google_genomics1/struct.ReadgroupsetSearchCall.html) +* [reads](http://byron.github.io/google-apis-rs/google_genomics1/struct.Read.html) + * [*search*](http://byron.github.io/google-apis-rs/google_genomics1/struct.ReadSearchCall.html) +* [references](http://byron.github.io/google-apis-rs/google_genomics1/struct.Reference.html) + * [*bases list*](http://byron.github.io/google-apis-rs/google_genomics1/struct.ReferenceBaseListCall.html), [*get*](http://byron.github.io/google-apis-rs/google_genomics1/struct.ReferenceGetCall.html) and [*search*](http://byron.github.io/google-apis-rs/google_genomics1/struct.ReferenceSearchCall.html) +* referencesets + * [*get*](http://byron.github.io/google-apis-rs/google_genomics1/struct.ReferencesetGetCall.html) and [*search*](http://byron.github.io/google-apis-rs/google_genomics1/struct.ReferencesetSearchCall.html) +* [variants](http://byron.github.io/google-apis-rs/google_genomics1/struct.Variant.html) + * [*create*](http://byron.github.io/google-apis-rs/google_genomics1/struct.VariantCreateCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_genomics1/struct.VariantDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_genomics1/struct.VariantGetCall.html), [*import*](http://byron.github.io/google-apis-rs/google_genomics1/struct.VariantImportCall.html), [*merge*](http://byron.github.io/google-apis-rs/google_genomics1/struct.VariantMergeCall.html), [*patch*](http://byron.github.io/google-apis-rs/google_genomics1/struct.VariantPatchCall.html) and [*search*](http://byron.github.io/google-apis-rs/google_genomics1/struct.VariantSearchCall.html) +* variantsets + * [*create*](http://byron.github.io/google-apis-rs/google_genomics1/struct.VariantsetCreateCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_genomics1/struct.VariantsetDeleteCall.html), [*export*](http://byron.github.io/google-apis-rs/google_genomics1/struct.VariantsetExportCall.html), [*get*](http://byron.github.io/google-apis-rs/google_genomics1/struct.VariantsetGetCall.html), [*patch*](http://byron.github.io/google-apis-rs/google_genomics1/struct.VariantsetPatchCall.html) and [*search*](http://byron.github.io/google-apis-rs/google_genomics1/struct.VariantsetSearchCall.html) @@ -39,6 +57,18 @@ Generally speaking, you can invoke *Activities* like this: let r = hub.resource().activity(...).doit() ``` +Or specifically ... + +```ignore +let r = hub.operations().delete(...).doit() +let r = hub.operations().cancel(...).doit() +let r = hub.variantsets().export(...).doit() +let r = hub.readgroupsets().export(...).doit() +let r = hub.variants().import(...).doit() +let r = hub.readgroupsets().import(...).doit() +let r = hub.operations().get(...).doit() +let r = hub.operations().list(...).doit() +``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be @@ -62,7 +92,7 @@ google-genomics1 = "*" extern crate hyper; extern crate yup_oauth2 as oauth2; extern crate google_genomics1 as genomics1; - +use genomics1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; use genomics1::Genomics; @@ -79,9 +109,33 @@ let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::new(), ::default(), None); let mut hub = Genomics::new(hyper::Client::new(), auth); +// You can configure optional parameters by calling the respective setters at will, and +// execute the final call using `doit()`. +// Values shown here are possibly random and not representative ! +let result = hub.operations().list("name") + .page_token("sit") + .page_size(-65) + .filter("sed") + .doit(); + +match result { + Err(e) => match e { + // The Error enum provides details about what exactly happened. + // You can also just use its `Debug`, `Display` or `Error` traits + Error::HttpError(_) + |Error::MissingAPIKey + |Error::MissingToken(_) + |Error::Cancelled + |Error::UploadSizeLimitExceeded(_, _) + |Error::Failure(_) + |Error::BadRequest(_) + |Error::FieldClash(_) + |Error::JsonDecodeError(_, _) => println!("{}", e), + }, + Ok(res) => println!("Success: {:?}", res), +} ``` - ## Handling Errors All errors produced by the system are provided either as [Result](http://byron.github.io/google-apis-rs/google_genomics1/enum.Result.html) enumeration as return value of diff --git a/gen/genomics1/src/cmn.rs b/gen/genomics1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/genomics1/src/cmn.rs +++ b/gen/genomics1/src/cmn.rs @@ -12,7 +12,7 @@ use oauth2::{TokenType, Retry, self}; use hyper; use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, HeaderFormat}; -use hyper::http::LINE_ENDING; +use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; @@ -504,7 +504,7 @@ impl ::std::ops::DerefMut for XUploadContentType { } impl Header for XUploadContentType { fn header_name() -> &'static str { "X-Upload-Content-Type" } - fn parse_header(raw: &[Vec]) -> Option { + fn parse_header(raw: &[Vec]) -> hyper::error::Result { hyper::header::parsing::from_one_raw_str(raw).map(XUploadContentType) } } @@ -569,8 +569,8 @@ impl Header for ContentRange { } /// We are not parsable, as parsing is done by the `Range` header - fn parse_header(_: &[Vec]) -> Option { - None + fn parse_header(_: &[Vec]) -> hyper::error::Result { + Err(hyper::error::Error::Method) } } @@ -595,19 +595,19 @@ impl Header for RangeResponseHeader { "Range" } - fn parse_header(raw: &[Vec]) -> Option { + fn parse_header(raw: &[Vec]) -> hyper::error::Result { if raw.len() > 0 { let v = &raw[0]; if let Ok(s) = std::str::from_utf8(v) { const PREFIX: &'static str = "bytes "; if s.starts_with(PREFIX) { if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { - return Some(RangeResponseHeader(c)) + return Ok(RangeResponseHeader(c)) } } } } - None + Err(hyper::error::Error::Method) } } diff --git a/gen/genomics1/src/lib.rs b/gen/genomics1/src/lib.rs index ee156f4f3f..1182c53add 100644 --- a/gen/genomics1/src/lib.rs +++ b/gen/genomics1/src/lib.rs @@ -2,12 +2,30 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *genomics* crate version *0.1.8+20150615*, where *20150615* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *genomics* crate version *0.1.8+20150716*, where *20150716* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/genomics1). //! # Features //! -//! It seems there is nothing you can do here ... . +//! Handle the following *Resources* with ease from the central [hub](struct.Genomics.html) ... //! +//! * callsets +//! * [*create*](struct.CallsetCreateCall.html), [*delete*](struct.CallsetDeleteCall.html), [*get*](struct.CallsetGetCall.html), [*patch*](struct.CallsetPatchCall.html) and [*search*](struct.CallsetSearchCall.html) +//! * [datasets](struct.Dataset.html) +//! * [*create*](struct.DatasetCreateCall.html), [*delete*](struct.DatasetDeleteCall.html), [*get*](struct.DatasetGetCall.html), [*list*](struct.DatasetListCall.html), [*patch*](struct.DatasetPatchCall.html) and [*undelete*](struct.DatasetUndeleteCall.html) +//! * [operations](struct.Operation.html) +//! * [*cancel*](struct.OperationCancelCall.html), [*delete*](struct.OperationDeleteCall.html), [*get*](struct.OperationGetCall.html) and [*list*](struct.OperationListCall.html) +//! * readgroupsets +//! * [*coveragebuckets list*](struct.ReadgroupsetCoveragebucketListCall.html), [*delete*](struct.ReadgroupsetDeleteCall.html), [*export*](struct.ReadgroupsetExportCall.html), [*get*](struct.ReadgroupsetGetCall.html), [*import*](struct.ReadgroupsetImportCall.html), [*patch*](struct.ReadgroupsetPatchCall.html) and [*search*](struct.ReadgroupsetSearchCall.html) +//! * [reads](struct.Read.html) +//! * [*search*](struct.ReadSearchCall.html) +//! * [references](struct.Reference.html) +//! * [*bases list*](struct.ReferenceBaseListCall.html), [*get*](struct.ReferenceGetCall.html) and [*search*](struct.ReferenceSearchCall.html) +//! * referencesets +//! * [*get*](struct.ReferencesetGetCall.html) and [*search*](struct.ReferencesetSearchCall.html) +//! * [variants](struct.Variant.html) +//! * [*create*](struct.VariantCreateCall.html), [*delete*](struct.VariantDeleteCall.html), [*get*](struct.VariantGetCall.html), [*import*](struct.VariantImportCall.html), [*merge*](struct.VariantMergeCall.html), [*patch*](struct.VariantPatchCall.html) and [*search*](struct.VariantSearchCall.html) +//! * variantsets +//! * [*create*](struct.VariantsetCreateCall.html), [*delete*](struct.VariantsetDeleteCall.html), [*export*](struct.VariantsetExportCall.html), [*get*](struct.VariantsetGetCall.html), [*patch*](struct.VariantsetPatchCall.html) and [*search*](struct.VariantsetSearchCall.html) //! //! //! @@ -39,6 +57,18 @@ //! let r = hub.resource().activity(...).doit() //! ``` //! +//! Or specifically ... +//! +//! ```ignore +//! let r = hub.operations().delete(...).doit() +//! let r = hub.operations().cancel(...).doit() +//! let r = hub.variantsets().export(...).doit() +//! let r = hub.readgroupsets().export(...).doit() +//! let r = hub.variants().import(...).doit() +//! let r = hub.readgroupsets().import(...).doit() +//! let r = hub.operations().get(...).doit() +//! let r = hub.operations().list(...).doit() +//! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` //! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be @@ -62,7 +92,7 @@ //! extern crate hyper; //! extern crate yup_oauth2 as oauth2; //! extern crate google_genomics1 as genomics1; -//! +//! use genomics1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; //! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -80,9 +110,33 @@ //! hyper::Client::new(), //! ::default(), None); //! let mut hub = Genomics::new(hyper::Client::new(), auth); +//! // You can configure optional parameters by calling the respective setters at will, and +//! // execute the final call using `doit()`. +//! // Values shown here are possibly random and not representative ! +//! let result = hub.operations().list("name") +//! .page_token("et") +//! .page_size(-45) +//! .filter("ut") +//! .doit(); +//! +//! match result { +//! Err(e) => match e { +//! // The Error enum provides details about what exactly happened. +//! // You can also just use its `Debug`, `Display` or `Error` traits +//! Error::HttpError(_) +//! |Error::MissingAPIKey +//! |Error::MissingToken(_) +//! |Error::Cancelled +//! |Error::UploadSizeLimitExceeded(_, _) +//! |Error::Failure(_) +//! |Error::BadRequest(_) +//! |Error::FieldClash(_) +//! |Error::JsonDecodeError(_, _) => println!("{}", e), +//! }, +//! Ok(res) => println!("Success: {:?}", res), +//! } //! # } //! ``` -//! //! ## Handling Errors //! //! All errors produced by the system are provided either as [Result](enum.Result.html) enumeration as return value of diff --git a/gen/genomics1/src/lib.rs.in b/gen/genomics1/src/lib.rs.in index db7e0aad64..24d2c05270 100644 --- a/gen/genomics1/src/lib.rs.in +++ b/gen/genomics1/src/lib.rs.in @@ -29,6 +29,44 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, // UTILITIES ### // ############ +/// Identifies the an OAuth2 authorization scope. +/// A scope is needed when requesting an +/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). +#[derive(PartialEq, Eq, Hash)] +pub enum Scope { + /// Manage your data in Google Cloud Storage + DevstorageReadWrite, + + /// View Genomics data + Readonly, + + /// View and manage your data across Google Cloud Platform services + CloudPlatform, + + /// View and manage Genomics data + Full, + + /// View and manage your data in Google BigQuery + Bigquery, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::DevstorageReadWrite => "https://www.googleapis.com/auth/devstorage.read_write", + Scope::Readonly => "https://www.googleapis.com/auth/genomics.readonly", + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + Scope::Full => "https://www.googleapis.com/auth/genomics", + Scope::Bigquery => "https://www.googleapis.com/auth/bigquery", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::Readonly + } +} @@ -46,7 +84,7 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// extern crate hyper; /// extern crate yup_oauth2 as oauth2; /// extern crate google_genomics1 as genomics1; -/// +/// use genomics1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -64,9 +102,33 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// hyper::Client::new(), /// ::default(), None); /// let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.operations().list("name") +/// .page_token("dolores") +/// .page_size(-63) +/// .filter("accusam") +/// .doit(); +/// +/// match result { +/// Err(e) => match e { +/// // The Error enum provides details about what exactly happened. +/// // You can also just use its `Debug`, `Display` or `Error` traits +/// Error::HttpError(_) +/// |Error::MissingAPIKey +/// |Error::MissingToken(_) +/// |Error::Cancelled +/// |Error::UploadSizeLimitExceeded(_, _) +/// |Error::Failure(_) +/// |Error::BadRequest(_) +/// |Error::FieldClash(_) +/// |Error::JsonDecodeError(_, _) => println!("{}", e), +/// }, +/// Ok(res) => println!("Success: {:?}", res), +/// } /// # } /// ``` -/// pub struct Genomics { client: RefCell, auth: RefCell, @@ -86,6 +148,33 @@ impl<'a, C, A> Genomics } } + pub fn callsets(&'a self) -> CallsetMethods<'a, C, A> { + CallsetMethods { hub: &self } + } + pub fn datasets(&'a self) -> DatasetMethods<'a, C, A> { + DatasetMethods { hub: &self } + } + pub fn operations(&'a self) -> OperationMethods<'a, C, A> { + OperationMethods { hub: &self } + } + pub fn readgroupsets(&'a self) -> ReadgroupsetMethods<'a, C, A> { + ReadgroupsetMethods { hub: &self } + } + pub fn reads(&'a self) -> ReadMethods<'a, C, A> { + ReadMethods { hub: &self } + } + pub fn references(&'a self) -> ReferenceMethods<'a, C, A> { + ReferenceMethods { hub: &self } + } + pub fn referencesets(&'a self) -> ReferencesetMethods<'a, C, A> { + ReferencesetMethods { hub: &self } + } + pub fn variants(&'a self) -> VariantMethods<'a, C, A> { + VariantMethods { hub: &self } + } + pub fn variantsets(&'a self) -> VariantsetMethods<'a, C, A> { + VariantsetMethods { hub: &self } + } /// Set the user-agent header field to use in all requests to the server. /// It defaults to `google-api-rust-client/0.1.8`. @@ -99,14 +188,12778 @@ impl<'a, C, A> Genomics } +// ############ +// SCHEMAS ### +// ########## +/// The read group set search request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search readgroupsets](struct.ReadgroupsetSearchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchReadGroupSetsRequest { + /// 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. + #[serde(rename="pageToken")] + pub page_token: Option, + /// Restricts this query to read group sets within the given datasets. At least one ID must be provided. + #[serde(rename="datasetIds")] + pub dataset_ids: Option>, + /// Only return read group sets for which a substring of the name matches this string. + pub name: Option, + /// Specifies number of results to return in a single page. If unspecified, it will default to 256. The maximum value is 1024. + #[serde(rename="pageSize")] + pub page_size: Option, +} + +impl RequestValue for SearchReadGroupSetsRequest {} + + +/// The search variant sets request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search variantsets](struct.VariantsetSearchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchVariantSetsRequest { + /// 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. + #[serde(rename="pageToken")] + pub page_token: Option, + /// Exactly one dataset ID must be provided here. Only variant sets which belong to this dataset will be returned. + #[serde(rename="datasetIds")] + pub dataset_ids: Option>, + /// The maximum number of variant sets to return in a request. + #[serde(rename="pageSize")] + pub page_size: Option, +} + +impl RequestValue for SearchVariantSetsRequest {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [bases list references](struct.ReferenceBaseListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListBasesResponse { + /// 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. This field will be empty if there aren't any additional results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The offset position (0-based) of the given `sequence` from the start of this `Reference`. This value will differ for each page in a paginated request. + pub offset: Option, + /// A substring of the bases that make up this reference. + pub sequence: Option, +} + +impl ResponseResult for ListBasesResponse {} + + +/// ReferenceBound records an upper bound for the starting coordinate of variants in a particular reference. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReferenceBound { + /// An upper bound (inclusive) on the starting coordinate of any variant in the reference sequence. + #[serde(rename="upperBound")] + pub upper_bound: Option, + /// The reference the bound is associate with. + #[serde(rename="referenceName")] + pub reference_name: Option, +} + +impl Part for ReferenceBound {} + + +/// The read group set export request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [export readgroupsets](struct.ReadgroupsetExportCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExportReadGroupSetRequest { + /// Required. The Google Developers Console project ID that owns this export. + #[serde(rename="projectId")] + pub project_id: Option, + /// The reference names to export. If this is not specified, all reference sequences, including unmapped reads, are exported. Use `*` to export only unmapped reads. + #[serde(rename="referenceNames")] + pub reference_names: Option>, + /// Required. 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. + #[serde(rename="exportUri")] + pub export_uri: Option, +} + +impl RequestValue for ExportReadGroupSetRequest {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Experiment { + /// The sequencing center used as part of this experiment. + #[serde(rename="sequencingCenter")] + pub sequencing_center: Option, + /// The library used as part of this experiment. Note: This is not an actual ID within this repository, but rather an identifier for a library which may be meaningful to some external system. + #[serde(rename="libraryId")] + pub library_id: Option, + /// The instrument model used as part of this experiment. This maps to sequencing technology in BAM. + #[serde(rename="instrumentModel")] + pub instrument_model: Option, + /// The platform unit used as part of this experiment e.g. flowcell-barcode.lane for Illumina or slide for SOLiD. Corresponds to the @RG PU field in the SAM spec. + #[serde(rename="platformUnit")] + pub platform_unit: Option, +} + +impl Part for Experiment {} + + +/// The variant search request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search variants](struct.VariantSearchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchVariantsRequest { + /// The end of the window, 0-based exclusive. If unspecified or 0, defaults to the length of the reference. + pub end: Option, + /// The maximum number of variants to return. If unspecified, defaults to 5000. + #[serde(rename="pageSize")] + pub page_size: Option, + /// 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. + #[serde(rename="pageToken")] + pub page_token: Option, + /// The maximum number of calls to return. However, at least one variant will always be returned, even if it has more calls than this limit. If unspecified, defaults to 5000. + #[serde(rename="maxCalls")] + pub max_calls: Option, + /// The beginning of the window (0-based, inclusive) for which overlapping variants should be returned. If unspecified, defaults to 0. + pub start: Option, + /// Only return variant calls which belong to call sets with these ids. Leaving this blank returns all variant calls. If a variant has no calls belonging to any of these call sets, it won't be returned at all. Currently, variants with no calls from any call set will never be returned. + #[serde(rename="callSetIds")] + pub call_set_ids: Option>, + /// Only return variants which have exactly this name. + #[serde(rename="variantName")] + pub variant_name: Option, + /// Required. Only return variants in this reference sequence. + #[serde(rename="referenceName")] + pub reference_name: Option, + /// At most one variant set ID must be provided. Only variants from this variant set will be returned. If omitted, a call set id must be included in the request. + #[serde(rename="variantSetIds")] + pub variant_set_ids: Option>, +} + +impl RequestValue for SearchVariantsRequest {} + + +/// The variant data import request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [import variants](struct.VariantImportCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ImportVariantsRequest { + /// Required. The variant set to which variant data should be imported. + #[serde(rename="variantSetId")] + pub variant_set_id: Option, + /// The format of the variant data being imported. If unspecified, defaults to to `VCF`. + pub format: Option, + /// A list of URIs referencing variant files in Google Cloud Storage. URIs can include wildcards [as described here](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames). Note that recursive wildcards ('**') are not supported. + #[serde(rename="sourceUris")] + pub source_uris: Option>, + /// Convert reference names to the canonical representation. hg19 haploytypes (those reference names containing "_hap") are not modified in any way. All other reference names are modified according to the following rules: The reference name is capitalized. The "chr" prefix is dropped for all autosomes and sex chromsomes. For example "chr17" becomes "17" and "chrX" becomes "X". All mitochondrial chromosomes ("chrM", "chrMT", etc) become "MT". + #[serde(rename="normalizeReferenceNames")] + pub normalize_reference_names: Option, +} + +impl RequestValue for ImportVariantsRequest {} + + +/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete operations](struct.OperationDeleteCall.html) (response) +/// * [delete datasets](struct.DatasetDeleteCall.html) (response) +/// * [cancel operations](struct.OperationCancelCall.html) (response) +/// * [delete readgroupsets](struct.ReadgroupsetDeleteCall.html) (response) +/// * [delete callsets](struct.CallsetDeleteCall.html) (response) +/// * [delete variantsets](struct.VariantsetDeleteCall.html) (response) +/// * [delete variants](struct.VariantDeleteCall.html) (response) +/// * [merge variants](struct.VariantMergeCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty; + +impl ResponseResult for Empty {} + + +/// A reference set is a set of references which typically comprise a reference assembly for a species, such as `GRCh38` which is representative of the human genome. A reference set defines a common coordinate space for comparing reference-aligned experimental data. A reference set contains 1 or more references. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get referencesets](struct.ReferencesetGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReferenceSet { + /// Free text description of this reference set. + pub description: Option, + /// The URI from which the references were obtained. + #[serde(rename="sourceUri")] + pub source_uri: Option, + /// The IDs of the reference objects that are part of this set. `Reference.md5checksum` must be unique within this set. + #[serde(rename="referenceIds")] + pub reference_ids: Option>, + /// Public id of this reference set, such as `GRCh37`. + #[serde(rename="assemblyId")] + pub assembly_id: Option, + /// All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally with a version number, for example `NC_000001.11`. + #[serde(rename="sourceAccessions")] + pub source_accessions: Option>, + /// ID from http://www.ncbi.nlm.nih.gov/taxonomy (e.g. 9606->human) indicating the species which this assembly is intended to model. Note that contained references may specify a different `ncbiTaxonId`, as assemblies may contain reference sequences which do not belong to the modeled species, e.g. EBV in a human reference genome. + #[serde(rename="ncbiTaxonId")] + pub ncbi_taxon_id: Option, + /// The server-generated reference set ID, unique across all reference sets. + pub id: Option, + /// Order-independent MD5 checksum which identifies this reference set. The checksum is computed by sorting all lower case hexidecimal string `reference.md5checksum` (for all reference in this set) in ascending lexicographic order, concatenating, and taking the MD5 of that value. The resulting value is represented in lower case hexadecimal format. + pub md5checksum: Option, +} + +impl Resource for ReferenceSet {} +impl ResponseResult for ReferenceSet {} + + +/// The `Status` defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). The error model is designed to be: - Simple to use and understand for most users. - Flexible enough to meet unexpected needs. # Overview The `Status` message contains 3 pieces of data: error code, error message, and error details. The error code should be an enum value of [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers *understand* and *resolve* the error. If a localized user-facing error message is needed, it can be sent in the error details or localized by the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package `google.rpc` which can be used for common error conditions. # Language mapping The `Status` message is the logical representation of the error model, but it is not necessarily the actual wire format. When the `Status` message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C. # Other uses The error model and the `Status` message can be used in a variety of environments - either with or without APIs - to provide consistent developer experience across different environments. Example uses of this error model include: - Partial errors. If a service needs to return partial errors to the client, it may embed the `Status` in the normal response to indicate the partial errors. - Workflow errors. A typical workflow has multiple steps. Each step may have a `Status` message for error reporting purpose. - Batch operations. If a client uses batch request and batch response, the `Status` message should be used directly inside batch response, one for each error sub-response. - Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the `Status` message. - Logging. If some API errors are stored in logs, the message `Status` could be used directly after any stripping needed for security/privacy reasons. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Status { + /// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + pub code: Option, + /// A list of messages that carry the error details. There will be a common set of message types for APIs to use. + pub details: Option>>, +} + +impl Part for Status {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [coveragebuckets list readgroupsets](struct.ReadgroupsetCoveragebucketListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListCoverageBucketsResponse { + /// The coverage buckets. The list of buckets is sparse; a bucket with 0 overlapping reads is not returned. A bucket never crosses more than one reference sequence. Each bucket has width `bucketWidth`, unless its end is the end of the reference sequence. + #[serde(rename="coverageBuckets")] + pub coverage_buckets: Option>, + /// 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. This field will be empty if there aren't any additional results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The length of each coverage bucket in base pairs. Note that buckets at the end of a reference sequence may be shorter. This value is omitted if the bucket width is infinity (the default behaviour, with no range or `targetBucketWidth`). + #[serde(rename="bucketWidth")] + pub bucket_width: Option, +} + +impl ResponseResult for ListCoverageBucketsResponse {} + + +/// A read alignment describes a linear alignment of a string of DNA to a [reference sequence][google.genomics.v1.Reference], in addition to metadata about the fragment (the molecule of DNA sequenced) and the read (the bases which were read by the sequencer). A read is equivalent to a line in a SAM file. A read belongs to exactly one read group and exactly one [read group set][google.genomics.v1.ReadGroupSet]. ### Generating a reference-aligned sequence string When interacting with mapped reads, it's often useful to produce a string representing the local alignment of the read to reference. The following pseudocode demonstrates one way of doing this: out = "" offset = 0 for c in read.alignment.cigar { switch c.operation { case "ALIGNMENT_MATCH", "SEQUENCE_MATCH", "SEQUENCE_MISMATCH": out += read.alignedSequence[offset:offset+c.operationLength] offset += c.operationLength break case "CLIP_SOFT", "INSERT": offset += c.operationLength break case "PAD": out += repeat("*", c.operationLength) break case "DELETE": out += repeat("-", c.operationLength) break case "SKIP": out += repeat(" ", c.operationLength) break case "CLIP_HARD": break } } return out ### Converting to SAM's CIGAR string The following pseudocode generates a SAM CIGAR string from the `cigar` field. Note that this is a lossy conversion (`cigar.referenceSequence` is lost). cigarMap = { "ALIGNMENT_MATCH": "M", "INSERT": "I", "DELETE": "D", "SKIP": "N", "CLIP_SOFT": "S", "CLIP_HARD": "H", "PAD": "P", "SEQUENCE_MATCH": "=", "SEQUENCE_MISMATCH": "X", } cigarStr = "" for c in read.alignment.cigar { cigarStr += c.operationLength + cigarMap[c.operation] } return cigarStr +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search reads](struct.ReadSearchCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Read { + /// The ID of the read group set this read belongs to. (Every read must belong to exactly one read group set.) + #[serde(rename="readGroupSetId")] + pub read_group_set_id: Option, + /// SAM flag 0x200 + #[serde(rename="failedVendorQualityChecks")] + pub failed_vendor_quality_checks: Option, + /// The fragment name. Equivalent to QNAME (query template name) in SAM. + #[serde(rename="fragmentName")] + pub fragment_name: Option, + /// The mapping of the primary alignment of the `(readNumber+1)%numberReads` read in the fragment. It replaces mate position and mate strand in SAM. + #[serde(rename="nextMatePosition")] + pub next_mate_position: Option, + /// Whether this alignment is supplementary. Equivalent to SAM flag 0x800. Supplementary alignments are used in the representation of a chimeric alignment. In a chimeric alignment, a read is split into multiple linear alignments that map to different reference contigs. The first linear alignment in the read will be designated as the representative alignment; the remaining linear alignments will be designated as supplementary alignments. These alignments may have different mapping quality scores. In each linear alignment in a chimeric alignment, the read will be hard clipped. The `alignedSequence` and `alignedQuality` fields in the alignment record will only represent the bases for its respective linear alignment. + #[serde(rename="supplementaryAlignment")] + pub supplementary_alignment: Option, + /// The observed length of the fragment, equivalent to TLEN in SAM. + #[serde(rename="fragmentLength")] + pub fragment_length: Option, + /// The server-generated read ID, unique across all reads. This is different from the `fragmentName`. + pub id: Option, + /// The linear alignment for this alignment record. This field will be null if the read is unmapped. + pub alignment: Option, + /// A map of additional read alignment information. This must be of the form map (string key mapping to a list of string values). + pub info: Option>>, + /// The fragment is a PCR or optical duplicate (SAM flag 0x400) + #[serde(rename="duplicateFragment")] + pub duplicate_fragment: Option, + /// The number of reads in the fragment (extension to SAM flag 0x1). + #[serde(rename="numberReads")] + pub number_reads: Option, + /// The read number in sequencing. 0-based and less than numberReads. This field replaces SAM flag 0x40 and 0x80. + #[serde(rename="readNumber")] + pub read_number: Option, + /// The orientation and the distance between reads from the fragment are consistent with the sequencing protocol (SAM flag 0x2) + #[serde(rename="properPlacement")] + pub proper_placement: Option, + /// The ID of the read group this read belongs to. (Every read must belong to exactly one read group.) + #[serde(rename="readGroupId")] + pub read_group_id: Option, + /// The quality of the read sequence contained in this alignment record. `alignedSequence` and `alignedQuality` may be shorter than the full read sequence and quality. This will occur if the alignment is part of a chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR for this read will begin/end with a hard clip operator that will indicate the length of the excised sequence. + #[serde(rename="alignedQuality")] + pub aligned_quality: Option>, + /// The bases of the read sequence contained in this alignment record, *without CIGAR operations applied*. `alignedSequence` and `alignedQuality` may be shorter than the full read sequence and quality. This will occur if the alignment is part of a chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR for this read will begin/end with a hard clip operator that will indicate the length of the excised sequence. + #[serde(rename="alignedSequence")] + pub aligned_sequence: Option, + /// Whether this alignment is secondary. Equivalent to SAM flag 0x100. A secondary alignment represents an alternative to the primary alignment for this read. Aligners may return secondary alignments if a read can map ambiguously to multiple coordinates in the genome. By convention, each read has one and only one alignment where both `secondaryAlignment` and `supplementaryAlignment` are false. + #[serde(rename="secondaryAlignment")] + pub secondary_alignment: Option, +} + +impl Resource for Read {} + + +/// A variant represents a change in DNA sequence relative to a reference sequence. For example, a variant could represent a SNP or an insertion. Variants belong to a variant set. Each of the calls on a variant represent a determination of genotype with respect to that variant. For example, a call might assign probability of 0.32 to the occurrence of a SNP named rs1234 in a sample named NA12345. A call belongs to a call set, which contains related calls typically from one sample. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [import variants](struct.VariantImportCall.html) (none) +/// * [delete variants](struct.VariantDeleteCall.html) (none) +/// * [create variants](struct.VariantCreateCall.html) (request|response) +/// * [get variants](struct.VariantGetCall.html) (response) +/// * [patch variants](struct.VariantPatchCall.html) (request|response) +/// * [merge variants](struct.VariantMergeCall.html) (none) +/// * [search variants](struct.VariantSearchCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Variant { + /// A map of additional variant information. This must be of the form map (string key mapping to a list of string values). + pub info: Option>>, + /// The ID of the variant set this variant belongs to. + #[serde(rename="variantSetId")] + pub variant_set_id: Option, + /// The end position (0-based) of this variant. This corresponds to the first base after the last base in the reference allele. So, the length of the reference allele is (end - start). This is useful for variants that don't explicitly give alternate bases, for example large deletions. + pub end: Option, + /// The variant calls for this particular variant. Each one represents the determination of genotype with respect to this variant. + pub calls: Option>, + /// The date this variant was created, in milliseconds from the epoch. + pub created: Option, + /// The server-generated variant ID, unique across all variants. + pub id: Option, + /// A list of filters (normally quality filters) this variant has failed. `PASS` indicates this variant has passed all filters. + pub filter: Option>, + /// The position at which this variant occurs (0-based). This corresponds to the first base of the string of reference bases. + pub start: Option, + /// Names for the variant, for example a RefSNP ID. + pub names: Option>, + /// The bases that appear instead of the reference bases. + #[serde(rename="alternateBases")] + pub alternate_bases: Option>, + /// The reference on which this variant occurs. (such as `chr20` or `X`) + #[serde(rename="referenceName")] + pub reference_name: Option, + /// A measure of how likely this variant is to be real. A higher value is better. + pub quality: Option, + /// The reference bases for this variant. They start at the given position. + #[serde(rename="referenceBases")] + pub reference_bases: Option, +} + +impl RequestValue for Variant {} +impl Resource for Variant {} +impl ResponseResult for Variant {} + + +/// The variant search response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search variants](struct.VariantSearchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchVariantsResponse { + /// 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. This field will be empty if there aren't any additional results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of matching Variants. + pub variants: Option>, +} + +impl ResponseResult for SearchVariantsResponse {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search referencesets](struct.ReferencesetSearchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchReferenceSetsResponse { + /// 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. This field will be empty if there aren't any additional results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The matching references sets. + #[serde(rename="referenceSets")] + pub reference_sets: Option>, +} + +impl ResponseResult for SearchReferenceSetsResponse {} + + +/// A variant set is a collection of call sets and variants. It contains summary statistics of those contents. A variant set belongs to a dataset. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [patch variantsets](struct.VariantsetPatchCall.html) (request|response) +/// * [create variantsets](struct.VariantsetCreateCall.html) (request|response) +/// * [get variantsets](struct.VariantsetGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VariantSet { + /// A list of all references used by the variants in a variant set with associated coordinate upper bounds for each one. + #[serde(rename="referenceBounds")] + pub reference_bounds: Option>, + /// The server-generated variant set ID, unique across all variant sets. + pub id: Option, + /// The dataset to which this variant set belongs. + #[serde(rename="datasetId")] + pub dataset_id: Option, + /// The metadata associated with this variant set. + pub metadata: Option>, +} + +impl RequestValue for VariantSet {} +impl Resource for VariantSet {} +impl ResponseResult for VariantSet {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [merge variants](struct.VariantMergeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MergeVariantsRequest { + /// The destination variant set. + #[serde(rename="variantSetId")] + pub variant_set_id: Option, + /// The variants to be merged with existing variants. + pub variants: Option>, +} + +impl RequestValue for MergeVariantsRequest {} + + +/// Metadata describes a single piece of variant call metadata. These data include a top level key and either a single value string (value) or a list of key-value pairs (info.) Value and info are mutually exclusive. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VariantSetMetadata { + /// Remaining structured metadata key-value pairs. This must be of the form map (string key mapping to a list of string values). + pub info: Option>>, + /// A textual description of this metadata. + pub description: Option, + /// The top-level key. + pub key: Option, + /// The type of data. Possible types include: Integer, Float, Flag, Character, and String. + #[serde(rename="type")] + pub type_: Option, + /// The number of values that can be included in a field described by this metadata. + pub number: Option, + /// The value field for simple metadata + pub value: Option, + /// User-provided ID field, not enforced by this API. Two or more pieces of structured metadata with identical id and key fields are considered equivalent. + pub id: Option, +} + +impl Part for VariantSetMetadata {} + + +/// The read search request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search reads](struct.ReadSearchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchReadsRequest { + /// The start position of the range on the reference, 0-based inclusive. If specified, `referenceName` must also be specified. + pub start: Option, + /// The IDs of the read groups sets within which to search for reads. All specified read group sets must be aligned against a common set of reference sequences; this defines the genomic coordinates for the query. Must specify one of `readGroupSetIds` or `readGroupIds`. + #[serde(rename="readGroupSetIds")] + pub read_group_set_ids: Option>, + /// The IDs of the read groups within which to search for reads. All specified read groups must belong to the same read group sets. Must specify one of `readGroupSetIds` or `readGroupIds`. + #[serde(rename="readGroupIds")] + pub read_group_ids: Option>, + /// Specifies number of results to return in a single page. If unspecified, it will default to 256. The maximum value is 2048. + #[serde(rename="pageSize")] + pub page_size: Option, + /// 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. + #[serde(rename="pageToken")] + pub page_token: Option, + /// The end position of the range on the reference, 0-based exclusive. If specified, `referenceName` must also be specified. + pub end: Option, + /// The reference sequence name, for example `chr1`, `1`, or `chrX`. If set to *, only unmapped reads are returned. + #[serde(rename="referenceName")] + pub reference_name: Option, +} + +impl RequestValue for SearchReadsRequest {} + + +/// A 0-based half-open genomic coordinate range for search requests. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Range { + /// The start position of the range on the reference, 0-based inclusive. + pub start: Option, + /// The end position of the range on the reference, 0-based exclusive. + pub end: Option, + /// The reference sequence name, for example `chr1`, `1`, or `chrX`. + #[serde(rename="referenceName")] + pub reference_name: Option, +} + +impl Part for Range {} + + +/// The search variant sets response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search variantsets](struct.VariantsetSearchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchVariantSetsResponse { + /// 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. This field will be empty if there aren't any additional results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The variant sets belonging to the requested dataset. + #[serde(rename="variantSets")] + pub variant_sets: Option>, +} + +impl ResponseResult for SearchVariantSetsResponse {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [undelete datasets](struct.DatasetUndeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UndeleteDatasetRequest; + +impl RequestValue for UndeleteDatasetRequest {} + + +/// A call set is a collection of variant calls, typically for one sample. It belongs to a variant set. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [create callsets](struct.CallsetCreateCall.html) (request|response) +/// * [patch callsets](struct.CallsetPatchCall.html) (request|response) +/// * [get callsets](struct.CallsetGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CallSet { + /// A map of additional call set information. This must be of the form map (string key mapping to a list of string values). + pub info: Option>>, + /// The IDs of the variant sets this call set belongs to. + #[serde(rename="variantSetIds")] + pub variant_set_ids: Option>, + /// The call set name. + pub name: Option, + /// The date this call set was created in milliseconds from the epoch. + pub created: Option, + /// The sample ID this call set corresponds to. + #[serde(rename="sampleId")] + pub sample_id: Option, + /// The server-generated call set ID, unique across all call sets. + pub id: Option, +} + +impl RequestValue for CallSet {} +impl Resource for CallSet {} +impl ResponseResult for CallSet {} + + +/// An abstraction for referring to a genomic position, in relation to some already known reference. For now, represents a genomic position as a reference name, a base number on that reference (0-based), and a determination of forward or reverse strand. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Position { + /// The 0-based offset from the start of the forward strand for that reference. + pub position: Option, + /// Whether this position is on the reverse strand, as opposed to the forward strand. + #[serde(rename="reverseStrand")] + pub reverse_strand: Option, + /// The name of the reference in whatever reference set is being used. + #[serde(rename="referenceName")] + pub reference_name: Option, +} + +impl Part for Position {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search references](struct.ReferenceSearchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchReferencesResponse { + /// 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. This field will be empty if there aren't any additional results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The matching references. + pub references: Option>, +} + +impl ResponseResult for SearchReferencesResponse {} + + +/// The call set search request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search callsets](struct.CallsetSearchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchCallSetsRequest { + /// 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. + #[serde(rename="pageToken")] + pub page_token: Option, + /// Restrict the query to call sets within the given variant sets. At least one ID must be provided. + #[serde(rename="variantSetIds")] + pub variant_set_ids: Option>, + /// Only return call sets for which a substring of the name matches this string. + pub name: Option, + /// The maximum number of call sets to return. If unspecified, defaults to 1000. + #[serde(rename="pageSize")] + pub page_size: Option, +} + +impl RequestValue for SearchCallSetsRequest {} + + +/// This resource represents a long-running operation that is the result of a network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete operations](struct.OperationDeleteCall.html) (none) +/// * [cancel operations](struct.OperationCancelCall.html) (none) +/// * [export variantsets](struct.VariantsetExportCall.html) (response) +/// * [export readgroupsets](struct.ReadgroupsetExportCall.html) (response) +/// * [import variants](struct.VariantImportCall.html) (response) +/// * [import readgroupsets](struct.ReadgroupsetImportCall.html) (response) +/// * [get operations](struct.OperationGetCall.html) (response) +/// * [list operations](struct.OperationListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// An [OperationMetadata][google.genomics.v1.OperationMetadata] object. This will always be returned with the [Operation][google.longrunning.Operation]. + pub metadata: Option>, + /// If the value is `false`, it means the operation is still in progress. If true, the operation is completed and the `result` is available. + pub done: Option, + /// If importing [ReadGroupSets][google.genomics.v1.ReadGroupSet], an [ImportReadGroupSetsResponse][google.genomics.v1.ImportReadGroupSetsResponse] is returned. If importing [Variants][google.genomics.v1.Variant], an [ImportVariantsResponse][google.genomics.v1.ImportVariantsResponse] is returned. For exports, an empty response is returned. + pub response: Option>, + /// The server-assigned name, which is only unique within the same service that originally returns it. For example: `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw` + pub name: Option, + /// The error result of the operation in case of failure. + pub error: Option, +} + +impl Resource for Operation {} +impl ResponseResult for Operation {} + + +/// The dataset list response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list datasets](struct.DatasetListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDatasetsResponse { + /// 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. This field will be empty if there aren't any additional results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of matching Datasets. + pub datasets: Option>, +} + +impl ResponseResult for ListDatasetsResponse {} + + +/// A read group set is a logical collection of read groups, which are collections of reads produced by a sequencer. A read group set typically models reads corresponding to one sample, sequenced one way, and aligned one way. * A read group set belongs to one dataset. * A read group belongs to one read group set. * A read belongs to one read group. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get readgroupsets](struct.ReadgroupsetGetCall.html) (response) +/// * [patch readgroupsets](struct.ReadgroupsetPatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReadGroupSet { + /// A map of additional read group set information. + pub info: Option>>, + /// The dataset ID. + #[serde(rename="datasetId")] + pub dataset_id: Option, + /// The read group set name. By default this will be initialized to the sample name of the sequenced data contained in this set. + pub name: Option, + /// The reference set the reads in this read group set are aligned to. + #[serde(rename="referenceSetId")] + pub reference_set_id: Option, + /// The server-generated read group set ID, unique for all read group sets. + pub id: Option, + /// The read groups in this set. There are typically 1-10 read groups in a read group set. + #[serde(rename="readGroups")] + pub read_groups: Option>, + /// The filename of the original source file for this read group set, if any. + pub filename: Option, +} + +impl RequestValue for ReadGroupSet {} +impl Resource for ReadGroupSet {} +impl ResponseResult for ReadGroupSet {} + + +/// The read group set import request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [import readgroupsets](struct.ReadgroupsetImportCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ImportReadGroupSetsRequest { + /// The reference set to which the imported read group sets are aligned to, if any. The reference names of this reference set must be a superset of those found in the imported file headers. If no reference set id is provided, a best effort is made to associate with a matching reference set. + #[serde(rename="referenceSetId")] + pub reference_set_id: Option, + /// A list of URIs pointing at BAM files in Google Cloud Storage. + #[serde(rename="sourceUris")] + pub source_uris: Option>, + /// The partition strategy describes how read groups are partitioned into read group sets. + #[serde(rename="partitionStrategy")] + pub partition_strategy: Option, + /// Required. The ID of the dataset these read group sets will belong to. The caller must have WRITE permissions to this dataset. + #[serde(rename="datasetId")] + pub dataset_id: Option, +} + +impl RequestValue for ImportReadGroupSetsRequest {} + + +/// The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list operations](struct.OperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListOperationsResponse { + /// A list of operations that matches the specified filter in the request. + pub operations: Option>, + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, +} + +impl ResponseResult for ListOperationsResponse {} + + +/// A reference is a canonical assembled DNA sequence, intended to act as a reference coordinate space for other genomic annotations. A single reference might represent the human chromosome 1 or mitochandrial DNA, for instance. A reference belongs to one or more reference sets. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [bases list references](struct.ReferenceBaseListCall.html) (none) +/// * [search references](struct.ReferenceSearchCall.html) (none) +/// * [get references](struct.ReferenceGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Reference { + /// MD5 of the upper-case sequence excluding all whitespace characters (this is equivalent to SQ:M5 in SAM). This value is represented in lower case hexadecimal format. + pub md5checksum: Option, + /// The length of this reference's sequence. + pub length: Option, + /// The name of this reference, for example `22`. + pub name: Option, + /// The URI from which the sequence was obtained. Specifies a FASTA format file/string with one name, sequence pair. + #[serde(rename="sourceUri")] + pub source_uri: Option, + /// All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally with a version number, for example `GCF_000001405.26`. + #[serde(rename="sourceAccessions")] + pub source_accessions: Option>, + /// The server-generated reference ID, unique across all references. + pub id: Option, + /// ID from http://www.ncbi.nlm.nih.gov/taxonomy (e.g. 9606->human) if not specified by the containing reference set. + #[serde(rename="ncbiTaxonId")] + pub ncbi_taxon_id: Option, +} + +impl Resource for Reference {} +impl ResponseResult for Reference {} + + +/// A linear alignment can be represented by one CIGAR string. Describes the mapped position and local alignment of the read to the reference. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LinearAlignment { + /// The position of this alignment. + pub position: Option, + /// Represents the local alignment of this sequence (alignment matches, indels, etc) against the reference. + pub cigar: Option>, + /// The mapping quality of this alignment. Represents how likely the read maps to this position as opposed to other locations. + #[serde(rename="mappingQuality")] + pub mapping_quality: Option, +} + +impl Part for LinearAlignment {} + + +/// The variant data export request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [export variantsets](struct.VariantsetExportCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExportVariantSetRequest { + /// Required. The Google Cloud project ID that owns the destination BigQuery dataset. The caller must have WRITE access to this project. This project will also own the resulting export job. + #[serde(rename="projectId")] + pub project_id: Option, + /// The format for the exported data. + pub format: Option, + /// Required. The BigQuery dataset to export data to. This dataset must already exist. Note that this is distinct from the Genomics concept of "dataset". + #[serde(rename="bigqueryDataset")] + pub bigquery_dataset: Option, + /// If provided, only variant call information from the specified call sets will be exported. By default all variant calls are exported. + #[serde(rename="callSetIds")] + pub call_set_ids: Option>, + /// Required. The BigQuery table to export data to. If the table doesn't exist, it will be created. If it already exists, it will be overwritten. + #[serde(rename="bigqueryTable")] + pub bigquery_table: Option, +} + +impl RequestValue for ExportVariantSetRequest {} + + +/// A call represents the determination of genotype with respect to a particular variant. It may include associated information such as quality and phasing. For example, a call might assign a probability of 0.32 to the occurrence of a SNP named rs1234 in a call set with the name NA12345. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VariantCall { + /// A map of additional variant call information. This must be of the form map (string key mapping to a list of string values). + pub info: Option>>, + /// The genotype of this variant call. Each value represents either the value of the `referenceBases` field or a 1-based index into `alternateBases`. If a variant had a `referenceBases` value of `T` and an `alternateBases` value of `["A", "C"]`, and the `genotype` was `[2, 1]`, that would mean the call represented the heterozygous value `CA` for this variant. If the `genotype` was instead `[0, 1]`, the represented value would be `TA`. Ordering of the genotype values is important if the `phaseset` is present. If a genotype is not called (that is, a `.` is present in the GT string) -1 is returned. + pub genotype: Option>, + /// The ID of the call set this variant call belongs to. + #[serde(rename="callSetId")] + pub call_set_id: Option, + /// If this field is present, this variant call's genotype ordering implies the phase of the bases and is consistent with any other variant calls in the same reference sequence which have the same phaseset value. When importing data from VCF, if the genotype data was phased but no phase set was specified this field will be set to `*`. + pub phaseset: Option, + /// The genotype likelihoods for this variant call. Each array entry represents how likely a specific genotype is for this call. The value ordering is defined by the GL tag in the VCF spec. If Phred-scaled genotype likelihood scores (PL) are available and log10(P) genotype likelihood scores (GL) are not, PL scores are converted to GL scores. If both are available, PL scores are stored in `info`. + #[serde(rename="genotypeLikelihood")] + pub genotype_likelihood: Option>, + /// The name of the call set this variant call belongs to. + #[serde(rename="callSetName")] + pub call_set_name: Option, +} + +impl Part for VariantCall {} + + +/// A single CIGAR operation. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CigarUnit { + /// `referenceSequence` is only used at mismatches (`SEQUENCE_MISMATCH`) and deletions (`DELETE`). Filling this field replaces SAM's MD tag. If the relevant information is not available, this field is unset. + #[serde(rename="referenceSequence")] + pub reference_sequence: Option, + /// no description provided + pub operation: Option, + /// The number of genomic bases that the operation runs for. Required. + #[serde(rename="operationLength")] + pub operation_length: Option, +} + +impl Part for CigarUnit {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search references](struct.ReferenceSearchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchReferencesRequest { + /// If present, return references for which the `md5checksum` matches. See `Reference.md5checksum` for construction details. + pub md5checksums: Option>, + /// 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. + #[serde(rename="pageToken")] + pub page_token: Option, + /// If present, return only references which belong to this reference set. + #[serde(rename="referenceSetId")] + pub reference_set_id: Option, + /// If present, return references for which the accession matches this string. Best to give a version number, for example `GCF_000001405.26`. If only the main accession number is given then all records with that main accession will be returned, whichever version. Note that different versions will have different sequences. + pub accessions: Option>, + /// Specifies the maximum number of results to return in a single page. + #[serde(rename="pageSize")] + pub page_size: Option, +} + +impl RequestValue for SearchReferencesRequest {} + + +/// A Dataset is a collection of genomic data. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete datasets](struct.DatasetDeleteCall.html) (none) +/// * [get datasets](struct.DatasetGetCall.html) (response) +/// * [undelete datasets](struct.DatasetUndeleteCall.html) (response) +/// * [create datasets](struct.DatasetCreateCall.html) (request|response) +/// * [patch datasets](struct.DatasetPatchCall.html) (request|response) +/// * [list datasets](struct.DatasetListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Dataset { + /// The Google Developers Console project ID that this dataset belongs to. + #[serde(rename="projectId")] + pub project_id: Option, + /// The server-generated dataset ID, unique across all datasets. + pub id: Option, + /// The dataset name. + pub name: Option, + /// The time this dataset was created, in seconds from the epoch. + #[serde(rename="createTime")] + pub create_time: Option, +} + +impl RequestValue for Dataset {} +impl Resource for Dataset {} +impl ResponseResult for Dataset {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Program { + /// The command line used to run this program. + #[serde(rename="commandLine")] + pub command_line: Option, + /// The version of the program run. + pub version: Option, + /// The user specified locally unique ID of the program. Used along with `prevProgramId` to define an ordering between programs. + pub id: Option, + /// The name of the program. + pub name: Option, + /// The ID of the program run before this one. + #[serde(rename="prevProgramId")] + pub prev_program_id: Option, +} + +impl Part for Program {} + + +/// A read group is all the data that's processed the same way by the sequencer. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReadGroup { + /// A map of additional read group information. This must be of the form map (string key mapping to a list of string values). + pub info: Option>>, + /// The predicted insert size of this read group. The insert size is the length the sequenced DNA fragment from end-to-end, not including the adapters. + #[serde(rename="predictedInsertSize")] + pub predicted_insert_size: Option, + /// A free-form text description of this read group. + pub description: Option, + /// The programs used to generate this read group. Programs are always identical for all read groups within a read group set. For this reason, only the first read group in a returned set will have this field populated. + pub programs: Option>, + /// The sample this read group's data was generated from. Note: This is not an actual ID within this repository, but rather an identifier for a sample which may be meaningful to some external system. + #[serde(rename="sampleId")] + pub sample_id: Option, + /// The experiment used to generate this read group. + pub experiment: Option, + /// The reference set the reads in this read group are aligned to. Required if there are any read alignments. + #[serde(rename="referenceSetId")] + pub reference_set_id: Option, + /// The server-generated read group ID, unique for all read groups. Note: This is different than the `@RG ID` field in the SAM spec. For that value, see the `name` field. + pub id: Option, + /// The ID of the dataset this read group belongs to. + #[serde(rename="datasetId")] + pub dataset_id: Option, + /// The read group name. This corresponds to the @RG ID field in the SAM spec. + pub name: Option, +} + +impl Part for ReadGroup {} + + +/// The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [cancel operations](struct.OperationCancelCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CancelOperationRequest; + +impl RequestValue for CancelOperationRequest {} + + +/// The read group set search response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search readgroupsets](struct.ReadgroupsetSearchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchReadGroupSetsResponse { + /// 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. This field will be empty if there aren't any additional results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of matching read group sets. + #[serde(rename="readGroupSets")] + pub read_group_sets: Option>, +} + +impl ResponseResult for SearchReadGroupSetsResponse {} + + +/// A bucket over which read coverage has been precomputed. A bucket corresponds to a specific range of the reference sequence. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CoverageBucket { + /// The average number of reads which are aligned to each individual reference base in this bucket. + #[serde(rename="meanCoverage")] + pub mean_coverage: Option, + /// The genomic coordinate range spanned by this bucket. + pub range: Option, +} + +impl Part for CoverageBucket {} + + +/// The call set search response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search callsets](struct.CallsetSearchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchCallSetsResponse { + /// 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. This field will be empty if there aren't any additional results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of matching call sets. + #[serde(rename="callSets")] + pub call_sets: Option>, +} + +impl ResponseResult for SearchCallSetsResponse {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search referencesets](struct.ReferencesetSearchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchReferenceSetsRequest { + /// If present, return references for which the `md5checksum` matches. See `ReferenceSet.md5checksum` for details. + pub md5checksums: Option>, + /// If present, return reference sets for which a substring of their `assemblyId` matches this string (case insensitive). + #[serde(rename="assemblyId")] + pub assembly_id: Option, + /// If present, return references for which the accession matches any of these strings. Best to give a version number, for example `GCF_000001405.26`. If only the main accession number is given then all records with that main accession will be returned, whichever version. Note that different versions will have different sequences. + pub accessions: Option>, + /// Specifies the maximum number of results to return in a single page. + #[serde(rename="pageSize")] + pub page_size: Option, + /// 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. + #[serde(rename="pageToken")] + pub page_token: Option, +} + +impl RequestValue for SearchReferenceSetsRequest {} + + +/// The read search response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [search reads](struct.ReadSearchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchReadsResponse { + /// 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. This field will be empty if there aren't any additional results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of matching alignments sorted by mapped genomic coordinate, if any, ascending in position within the same reference. Unmapped reads, which have no position, are returned last and are further sorted in ascending lexicographic order by fragment name. + pub alignments: Option>, +} + +impl ResponseResult for SearchReadsResponse {} + + // ################### // MethodBuilders ### // ################# +/// A builder providing access to all methods supported on *operation* resources. +/// It is not used directly, but through the `Genomics` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_genomics1 as genomics1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use genomics1::Genomics; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `cancel(...)`, `delete(...)`, `get(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.operations(); +/// # } +/// ``` +pub struct OperationMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, +} + +impl<'a, C, A> MethodsBuilder for OperationMethods<'a, C, A> {} + +impl<'a, C, A> OperationMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use [Operations.GetOperation][google.longrunning.Operations.GetOperation] or [Operations.ListOperations][google.longrunning.Operations.ListOperations] to check whether the cancellation succeeded or the operation completed despite cancellation. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the operation resource to be cancelled. + pub fn cancel(&self, request: CancelOperationRequest, name: &str) -> OperationCancelCall<'a, C, A> { + OperationCancelCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn get(&self, name: &str) -> OperationGetCall<'a, C, A> { + OperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists operations that match the specified filter in the request. + /// + /// # Arguments + /// + /// * `name` - The name of the operation collection. + pub fn list(&self, name: &str) -> OperationListCall<'a, C, A> { + OperationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// This method is not implemented. To cancel an operation, please use [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be deleted. + pub fn delete(&self, name: &str) -> OperationDeleteCall<'a, C, A> { + OperationDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *dataset* resources. +/// It is not used directly, but through the `Genomics` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_genomics1 as genomics1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use genomics1::Genomics; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `create(...)`, `delete(...)`, `get(...)`, `list(...)`, `patch(...)` and `undelete(...)` +/// // to build up your call. +/// let rb = hub.datasets(); +/// # } +/// ``` +pub struct DatasetMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, +} + +impl<'a, C, A> MethodsBuilder for DatasetMethods<'a, C, A> {} + +impl<'a, C, A> DatasetMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Creates a new dataset. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: Dataset) -> DatasetCreateCall<'a, C, A> { + DatasetCreateCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a dataset. + /// + /// # Arguments + /// + /// * `datasetId` - The ID of the dataset to be deleted. + pub fn delete(&self, dataset_id: &str) -> DatasetDeleteCall<'a, C, A> { + DatasetDeleteCall { + hub: self.hub, + _dataset_id: dataset_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Undeletes a dataset by restoring a dataset which was deleted via this API. This operation is only possible for a week after the deletion occurred. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `datasetId` - The ID of the dataset to be undeleted. + pub fn undelete(&self, request: UndeleteDatasetRequest, dataset_id: &str) -> DatasetUndeleteCall<'a, C, A> { + DatasetUndeleteCall { + hub: self.hub, + _request: request, + _dataset_id: dataset_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a dataset by ID. + /// + /// # Arguments + /// + /// * `datasetId` - The ID of the dataset. + pub fn get(&self, dataset_id: &str) -> DatasetGetCall<'a, C, A> { + DatasetGetCall { + hub: self.hub, + _dataset_id: dataset_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a dataset. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `datasetId` - The ID of the dataset to be updated. + pub fn patch(&self, request: Dataset, dataset_id: &str) -> DatasetPatchCall<'a, C, A> { + DatasetPatchCall { + hub: self.hub, + _request: request, + _dataset_id: dataset_id.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists datasets within a project. + pub fn list(&self) -> DatasetListCall<'a, C, A> { + DatasetListCall { + hub: self.hub, + _project_id: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *referenceset* resources. +/// It is not used directly, but through the `Genomics` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_genomics1 as genomics1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use genomics1::Genomics; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)` and `search(...)` +/// // to build up your call. +/// let rb = hub.referencesets(); +/// # } +/// ``` +pub struct ReferencesetMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, +} + +impl<'a, C, A> MethodsBuilder for ReferencesetMethods<'a, C, A> {} + +impl<'a, C, A> ReferencesetMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Searches for reference sets which match the given criteria. Implements [GlobalAllianceApi.searchReferenceSets](http://ga4gh.org/documentation/api/v0.5.1/ga4gh_api.html#/schema/org.ga4gh.searchReferenceSets). + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn search(&self, request: SearchReferenceSetsRequest) -> ReferencesetSearchCall<'a, C, A> { + ReferencesetSearchCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a reference set. Implements [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83). + /// + /// # Arguments + /// + /// * `referenceSetId` - The ID of the reference set. + pub fn get(&self, reference_set_id: &str) -> ReferencesetGetCall<'a, C, A> { + ReferencesetGetCall { + hub: self.hub, + _reference_set_id: reference_set_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *callset* resources. +/// It is not used directly, but through the `Genomics` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_genomics1 as genomics1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use genomics1::Genomics; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `create(...)`, `delete(...)`, `get(...)`, `patch(...)` and `search(...)` +/// // to build up your call. +/// let rb = hub.callsets(); +/// # } +/// ``` +pub struct CallsetMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, +} + +impl<'a, C, A> MethodsBuilder for CallsetMethods<'a, C, A> {} + +impl<'a, C, A> CallsetMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets a list of call sets matching the criteria. Implements [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178). + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn search(&self, request: SearchCallSetsRequest) -> CallsetSearchCall<'a, C, A> { + CallsetSearchCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a call set. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `callSetId` - The ID of the call set to be updated. + pub fn patch(&self, request: CallSet, call_set_id: &str) -> CallsetPatchCall<'a, C, A> { + CallsetPatchCall { + hub: self.hub, + _request: request, + _call_set_id: call_set_id.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new call set. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: CallSet) -> CallsetCreateCall<'a, C, A> { + CallsetCreateCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a call set. + /// + /// # Arguments + /// + /// * `callSetId` - The ID of the call set to be deleted. + pub fn delete(&self, call_set_id: &str) -> CallsetDeleteCall<'a, C, A> { + CallsetDeleteCall { + hub: self.hub, + _call_set_id: call_set_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a call set by ID. + /// + /// # Arguments + /// + /// * `callSetId` - The ID of the call set. + pub fn get(&self, call_set_id: &str) -> CallsetGetCall<'a, C, A> { + CallsetGetCall { + hub: self.hub, + _call_set_id: call_set_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *read* resources. +/// It is not used directly, but through the `Genomics` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_genomics1 as genomics1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use genomics1::Genomics; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `search(...)` +/// // to build up your call. +/// let rb = hub.reads(); +/// # } +/// ``` +pub struct ReadMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, +} + +impl<'a, C, A> MethodsBuilder for ReadMethods<'a, C, A> {} + +impl<'a, C, A> ReadMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets a list of reads for one or more read group sets. Reads search operates over a genomic coordinate space of reference sequence & position defined over the reference sequences to which the requested read group sets are aligned. If a target positional range is specified, search returns all reads whose alignment to the reference genome overlap the range. A query which specifies only read group set IDs yields all reads in those read group sets, including unmapped reads. All reads returned (including reads on subsequent pages) are ordered by genomic coordinate (reference sequence & position). Reads with equivalent genomic coordinates are returned in a deterministic order. Implements [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85). + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn search(&self, request: SearchReadsRequest) -> ReadSearchCall<'a, C, A> { + ReadSearchCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *readgroupset* resources. +/// It is not used directly, but through the `Genomics` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_genomics1 as genomics1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use genomics1::Genomics; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `coveragebuckets_list(...)`, `delete(...)`, `export(...)`, `get(...)`, `import(...)`, `patch(...)` and `search(...)` +/// // to build up your call. +/// let rb = hub.readgroupsets(); +/// # } +/// ``` +pub struct ReadgroupsetMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, +} + +impl<'a, C, A> MethodsBuilder for ReadgroupsetMethods<'a, C, A> {} + +impl<'a, C, A> ReadgroupsetMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Exports a read group set to a BAM file in Google Cloud Storage. Note that currently there may be some differences between exported BAM files and the original BAM file at the time of import. In particular, comments in the input file header will not be preserved, some custom tags will be converted to strings, and original reference sequence order is not necessarily preserved. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `readGroupSetId` - Required. The ID of the read group set to export. + pub fn export(&self, request: ExportReadGroupSetRequest, read_group_set_id: &str) -> ReadgroupsetExportCall<'a, C, A> { + ReadgroupsetExportCall { + hub: self.hub, + _request: request, + _read_group_set_id: read_group_set_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates read group sets by asynchronously importing the provided information. Note that currently comments in the input file header are **not** imported and some custom tags will be converted to strings, rather than preserving tag types. The caller must have WRITE permissions to the dataset. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn import(&self, request: ImportReadGroupSetsRequest) -> ReadgroupsetImportCall<'a, C, A> { + ReadgroupsetImportCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a read group set. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `readGroupSetId` - The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set. + pub fn patch(&self, request: ReadGroupSet, read_group_set_id: &str) -> ReadgroupsetPatchCall<'a, C, A> { + ReadgroupsetPatchCall { + hub: self.hub, + _request: request, + _read_group_set_id: read_group_set_id.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists fixed width coverage buckets for a read group set, each of which correspond to a range of a reference sequence. Each bucket summarizes coverage information across its corresponding genomic range. Coverage is defined as the number of reads which are aligned to a given base in the reference sequence. Coverage buckets are available at several precomputed bucket widths, enabling retrieval of various coverage 'zoom levels'. The caller must have READ permissions for the target read group set. + /// + /// # Arguments + /// + /// * `readGroupSetId` - Required. The ID of the read group set over which coverage is requested. + pub fn coveragebuckets_list(&self, read_group_set_id: &str) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { + ReadgroupsetCoveragebucketListCall { + hub: self.hub, + _read_group_set_id: read_group_set_id.to_string(), + _target_bucket_width: Default::default(), + _start: Default::default(), + _reference_name: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _end: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a read group set. + /// + /// # Arguments + /// + /// * `readGroupSetId` - The ID of the read group set to be deleted. The caller must have WRITE permissions to the dataset associated with this read group set. + pub fn delete(&self, read_group_set_id: &str) -> ReadgroupsetDeleteCall<'a, C, A> { + ReadgroupsetDeleteCall { + hub: self.hub, + _read_group_set_id: read_group_set_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Searches for read group sets matching the criteria. Implements [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135). + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn search(&self, request: SearchReadGroupSetsRequest) -> ReadgroupsetSearchCall<'a, C, A> { + ReadgroupsetSearchCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a read group set by ID. + /// + /// # Arguments + /// + /// * `readGroupSetId` - The ID of the read group set. + pub fn get(&self, read_group_set_id: &str) -> ReadgroupsetGetCall<'a, C, A> { + ReadgroupsetGetCall { + hub: self.hub, + _read_group_set_id: read_group_set_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *reference* resources. +/// It is not used directly, but through the `Genomics` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_genomics1 as genomics1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use genomics1::Genomics; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `bases_list(...)`, `get(...)` and `search(...)` +/// // to build up your call. +/// let rb = hub.references(); +/// # } +/// ``` +pub struct ReferenceMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, +} + +impl<'a, C, A> MethodsBuilder for ReferenceMethods<'a, C, A> {} + +impl<'a, C, A> ReferenceMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists the bases in a reference, optionally restricted to a range. Implements [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221). + /// + /// # Arguments + /// + /// * `referenceId` - The ID of the reference. + pub fn bases_list(&self, reference_id: &str) -> ReferenceBaseListCall<'a, C, A> { + ReferenceBaseListCall { + hub: self.hub, + _reference_id: reference_id.to_string(), + _start: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _end: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Searches for references which match the given criteria. Implements [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146). + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn search(&self, request: SearchReferencesRequest) -> ReferenceSearchCall<'a, C, A> { + ReferenceSearchCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a reference. Implements [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158). + /// + /// # Arguments + /// + /// * `referenceId` - The ID of the reference. + pub fn get(&self, reference_id: &str) -> ReferenceGetCall<'a, C, A> { + ReferenceGetCall { + hub: self.hub, + _reference_id: reference_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *variant* resources. +/// It is not used directly, but through the `Genomics` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_genomics1 as genomics1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use genomics1::Genomics; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `create(...)`, `delete(...)`, `get(...)`, `import(...)`, `merge(...)`, `patch(...)` and `search(...)` +/// // to build up your call. +/// let rb = hub.variants(); +/// # } +/// ``` +pub struct VariantMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, +} + +impl<'a, C, A> MethodsBuilder for VariantMethods<'a, C, A> {} + +impl<'a, C, A> VariantMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets a list of variants matching the criteria. Implements [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126). + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn search(&self, request: SearchVariantsRequest) -> VariantSearchCall<'a, C, A> { + VariantSearchCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a variant. + /// + /// # Arguments + /// + /// * `variantId` - The ID of the variant to be deleted. + pub fn delete(&self, variant_id: &str) -> VariantDeleteCall<'a, C, A> { + VariantDeleteCall { + hub: self.hub, + _variant_id: variant_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a variant by ID. + /// + /// # Arguments + /// + /// * `variantId` - The ID of the variant. + pub fn get(&self, variant_id: &str) -> VariantGetCall<'a, C, A> { + VariantGetCall { + hub: self.hub, + _variant_id: variant_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Merges the given variants with existing variants. Each variant will be merged with an existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant, and other fields (such as key/value pairs) are discarded. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn merge(&self, request: MergeVariantsRequest) -> VariantMergeCall<'a, C, A> { + VariantMergeCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new variant. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: Variant) -> VariantCreateCall<'a, C, A> { + VariantCreateCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates variant data by asynchronously importing the provided information. The variants for import will be merged with any existing data and each other according to the behavior of mergeVariants. In particular, this means for merged VCF variants that have conflicting INFO fields, some data will be arbitrarily discarded. As a special case, for single-sample VCF files, QUAL and FILTER fields will be moved to the call level; these are sometimes interpreted in a call-specific context. Imported VCF headers are appended to the metadata already in a variant set. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn import(&self, request: ImportVariantsRequest) -> VariantImportCall<'a, C, A> { + VariantImportCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a variant. This method supports patch semantics. Returns the modified variant without its calls. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `variantId` - The ID of the variant to be updated. + pub fn patch(&self, request: Variant, variant_id: &str) -> VariantPatchCall<'a, C, A> { + VariantPatchCall { + hub: self.hub, + _request: request, + _variant_id: variant_id.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *variantset* resources. +/// It is not used directly, but through the `Genomics` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_genomics1 as genomics1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use genomics1::Genomics; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `create(...)`, `delete(...)`, `export(...)`, `get(...)`, `patch(...)` and `search(...)` +/// // to build up your call. +/// let rb = hub.variantsets(); +/// # } +/// ``` +pub struct VariantsetMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, +} + +impl<'a, C, A> MethodsBuilder for VariantsetMethods<'a, C, A> {} + +impl<'a, C, A> VariantsetMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Creates a new variant set. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: VariantSet) -> VariantsetCreateCall<'a, C, A> { + VariantsetCreateCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Exports variant set data to an external destination. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `variantSetId` - Required. The ID of the variant set that contains variant data which should be exported. The caller must have READ access to this variant set. + pub fn export(&self, request: ExportVariantSetRequest, variant_set_id: &str) -> VariantsetExportCall<'a, C, A> { + VariantsetExportCall { + hub: self.hub, + _request: request, + _variant_set_id: variant_set_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a variant set. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `variantSetId` - The ID of the variant to be updated (must already exist). + pub fn patch(&self, request: VariantSet, variant_set_id: &str) -> VariantsetPatchCall<'a, C, A> { + VariantsetPatchCall { + hub: self.hub, + _request: request, + _variant_set_id: variant_set_id.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns a list of all variant sets matching search criteria. Implements [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49). + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn search(&self, request: SearchVariantSetsRequest) -> VariantsetSearchCall<'a, C, A> { + VariantsetSearchCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a variant set by ID. + /// + /// # Arguments + /// + /// * `variantSetId` - Required. The ID of the variant set. + pub fn get(&self, variant_set_id: &str) -> VariantsetGetCall<'a, C, A> { + VariantsetGetCall { + hub: self.hub, + _variant_set_id: variant_set_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the contents of a variant set. The variant set object is not deleted. + /// + /// # Arguments + /// + /// * `variantSetId` - The ID of the variant set to be deleted. + pub fn delete(&self, variant_set_id: &str) -> VariantsetDeleteCall<'a, C, A> { + VariantsetDeleteCall { + hub: self.hub, + _variant_set_id: variant_set_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + // ################### // CallBuilders ### // ################# +/// Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use [Operations.GetOperation][google.longrunning.Operations.GetOperation] or [Operations.ListOperations][google.longrunning.Operations.ListOperations] to check whether the cancellation succeeded or the operation completed despite cancellation. +/// +/// A builder for the *cancel* method supported by a *operation* resource. +/// It is not used directly, but through a `OperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::CancelOperationRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CancelOperationRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.operations().cancel(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct OperationCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: CancelOperationRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperationCancelCall<'a, C, A> {} + +impl<'a, C, A> OperationCancelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, FORM_URLENCODED_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/{+name}:cancel".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), FORM_URLENCODED_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CancelOperationRequest) -> OperationCancelCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the operation resource to be cancelled. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OperationCancelCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OperationCancelCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OperationCancelCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OperationCancelCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. +/// +/// A builder for the *get* method supported by a *operation* resource. +/// It is not used directly, but through a `OperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.operations().get("name") +/// .doit(); +/// # } +/// ``` +pub struct OperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperationGetCall<'a, C, A> {} + +impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, FORM_URLENCODED_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/{+name}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), FORM_URLENCODED_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OperationGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists operations that match the specified filter in the request. +/// +/// A builder for the *list* method supported by a *operation* resource. +/// It is not used directly, but through a `OperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.operations().list("name") +/// .page_token("erat") +/// .page_size(-35) +/// .filter("sea") +/// .doit(); +/// # } +/// ``` +pub struct OperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperationListCall<'a, C, A> {} + +impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOperationsResponse)> { + use url::percent_encoding::{percent_encode, FORM_URLENCODED_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/{+name}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), FORM_URLENCODED_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation collection. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard List page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of results to return. If unspecified, defaults to 256. The maximum value is 2048. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> OperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// A string for filtering [Operations][google.longrunning.Operation]. The following filter fields are supported: * projectId: Required. Corresponds to [OperationMetadata.projectId][google.genomics.v1.OperationMetadata.project_id]. * createTime: The time this job was created, in seconds from the [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `>=` and/or `= 1432140000` * `projectId = my-project AND createTime >= 1432140000 AND createTime <= 1432150000 AND status = RUNNING` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> OperationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OperationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OperationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OperationListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// This method is not implemented. To cancel an operation, please use [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. +/// +/// A builder for the *delete* method supported by a *operation* resource. +/// It is not used directly, but through a `OperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.operations().delete("name") +/// .doit(); +/// # } +/// ``` +pub struct OperationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperationDeleteCall<'a, C, A> {} + +impl<'a, C, A> OperationDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, FORM_URLENCODED_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.operations.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/{+name}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), FORM_URLENCODED_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be deleted. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OperationDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OperationDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OperationDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OperationDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates a new dataset. +/// +/// A builder for the *create* method supported by a *dataset* resource. +/// It is not used directly, but through a `DatasetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::Dataset; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Dataset::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.datasets().create(req) +/// .doit(); +/// # } +/// ``` +pub struct DatasetCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: Dataset, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DatasetCreateCall<'a, C, A> {} + +impl<'a, C, A> DatasetCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Dataset)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.datasets.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/datasets".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Dataset) -> DatasetCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatasetCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> DatasetCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DatasetCreateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Deletes a dataset. +/// +/// A builder for the *delete* method supported by a *dataset* resource. +/// It is not used directly, but through a `DatasetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.datasets().delete("datasetId") +/// .doit(); +/// # } +/// ``` +pub struct DatasetDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _dataset_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DatasetDeleteCall<'a, C, A> {} + +impl<'a, C, A> DatasetDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.datasets.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("datasetId", self._dataset_id.to_string())); + for &field in ["alt", "datasetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/datasets/{datasetId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{datasetId}", "datasetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["datasetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the dataset to be deleted. + /// + /// Sets the *dataset id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dataset_id(mut self, new_value: &str) -> DatasetDeleteCall<'a, C, A> { + self._dataset_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatasetDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> DatasetDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DatasetDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Undeletes a dataset by restoring a dataset which was deleted via this API. This operation is only possible for a week after the deletion occurred. +/// +/// A builder for the *undelete* method supported by a *dataset* resource. +/// It is not used directly, but through a `DatasetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::UndeleteDatasetRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = UndeleteDatasetRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.datasets().undelete(req, "datasetId") +/// .doit(); +/// # } +/// ``` +pub struct DatasetUndeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: UndeleteDatasetRequest, + _dataset_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DatasetUndeleteCall<'a, C, A> {} + +impl<'a, C, A> DatasetUndeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Dataset)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.datasets.undelete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("datasetId", self._dataset_id.to_string())); + for &field in ["alt", "datasetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/datasets/{datasetId}:undelete".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{datasetId}", "datasetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["datasetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UndeleteDatasetRequest) -> DatasetUndeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the dataset to be undeleted. + /// + /// Sets the *dataset id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dataset_id(mut self, new_value: &str) -> DatasetUndeleteCall<'a, C, A> { + self._dataset_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatasetUndeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> DatasetUndeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DatasetUndeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a dataset by ID. +/// +/// A builder for the *get* method supported by a *dataset* resource. +/// It is not used directly, but through a `DatasetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.datasets().get("datasetId") +/// .doit(); +/// # } +/// ``` +pub struct DatasetGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _dataset_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DatasetGetCall<'a, C, A> {} + +impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Dataset)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.datasets.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("datasetId", self._dataset_id.to_string())); + for &field in ["alt", "datasetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/datasets/{datasetId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{datasetId}", "datasetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["datasetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the dataset. + /// + /// Sets the *dataset id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dataset_id(mut self, new_value: &str) -> DatasetGetCall<'a, C, A> { + self._dataset_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatasetGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> DatasetGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DatasetGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates a dataset. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *dataset* resource. +/// It is not used directly, but through a `DatasetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::Dataset; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Dataset::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.datasets().patch(req, "datasetId") +/// .update_mask("ea") +/// .doit(); +/// # } +/// ``` +pub struct DatasetPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: Dataset, + _dataset_id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DatasetPatchCall<'a, C, A> {} + +impl<'a, C, A> DatasetPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Dataset)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.datasets.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("datasetId", self._dataset_id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "datasetId", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/datasets/{datasetId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{datasetId}", "datasetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["datasetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Dataset) -> DatasetPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the dataset to be updated. + /// + /// Sets the *dataset id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dataset_id(mut self, new_value: &str) -> DatasetPatchCall<'a, C, A> { + self._dataset_id = new_value.to_string(); + self + } + /// An optional mask specifying which fields to update. At this time, the only mutable field is [name][google.genomics.v1.Dataset.name]. The only acceptable value is "name". If unspecified, all mutable fields will be updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> DatasetPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatasetPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> DatasetPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DatasetPatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists datasets within a project. +/// +/// A builder for the *list* method supported by a *dataset* resource. +/// It is not used directly, but through a `DatasetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.datasets().list() +/// .project_id("no") +/// .page_token("justo") +/// .page_size(-21) +/// .doit(); +/// # } +/// ``` +pub struct DatasetListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _project_id: Option, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DatasetListCall<'a, C, A> {} + +impl<'a, C, A> DatasetListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListDatasetsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.datasets.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + if let Some(value) = self._project_id { + params.push(("projectId", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "projectId", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/datasets".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The project to list datasets for. + /// + /// Sets the *project id* query property to the given value. + pub fn project_id(mut self, new_value: &str) -> DatasetListCall<'a, C, A> { + self._project_id = Some(new_value.to_string()); + self + } + /// 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. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> DatasetListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of results returned by this request. If unspecified, defaults to 50. The maximum value is 1024. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> DatasetListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatasetListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> DatasetListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DatasetListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Searches for reference sets which match the given criteria. Implements [GlobalAllianceApi.searchReferenceSets](http://ga4gh.org/documentation/api/v0.5.1/ga4gh_api.html#/schema/org.ga4gh.searchReferenceSets). +/// +/// A builder for the *search* method supported by a *referenceset* resource. +/// It is not used directly, but through a `ReferencesetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::SearchReferenceSetsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SearchReferenceSetsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.referencesets().search(req) +/// .doit(); +/// # } +/// ``` +pub struct ReferencesetSearchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: SearchReferenceSetsRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReferencesetSearchCall<'a, C, A> {} + +impl<'a, C, A> ReferencesetSearchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SearchReferenceSetsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.referencesets.search", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/referencesets/search".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SearchReferenceSetsRequest) -> ReferencesetSearchCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReferencesetSearchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ReferencesetSearchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReferencesetSearchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a reference set. Implements [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83). +/// +/// A builder for the *get* method supported by a *referenceset* resource. +/// It is not used directly, but through a `ReferencesetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.referencesets().get("referenceSetId") +/// .doit(); +/// # } +/// ``` +pub struct ReferencesetGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _reference_set_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReferencesetGetCall<'a, C, A> {} + +impl<'a, C, A> ReferencesetGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ReferenceSet)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.referencesets.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("referenceSetId", self._reference_set_id.to_string())); + for &field in ["alt", "referenceSetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/referencesets/{referenceSetId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{referenceSetId}", "referenceSetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["referenceSetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the reference set. + /// + /// Sets the *reference set id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn reference_set_id(mut self, new_value: &str) -> ReferencesetGetCall<'a, C, A> { + self._reference_set_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReferencesetGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ReferencesetGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReferencesetGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a list of call sets matching the criteria. Implements [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178). +/// +/// A builder for the *search* method supported by a *callset* resource. +/// It is not used directly, but through a `CallsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::SearchCallSetsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SearchCallSetsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.callsets().search(req) +/// .doit(); +/// # } +/// ``` +pub struct CallsetSearchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: SearchCallSetsRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CallsetSearchCall<'a, C, A> {} + +impl<'a, C, A> CallsetSearchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SearchCallSetsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.callsets.search", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/callsets/search".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SearchCallSetsRequest) -> CallsetSearchCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> CallsetSearchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> CallsetSearchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> CallsetSearchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates a call set. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *callset* resource. +/// It is not used directly, but through a `CallsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::CallSet; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CallSet::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.callsets().patch(req, "callSetId") +/// .update_mask("diam") +/// .doit(); +/// # } +/// ``` +pub struct CallsetPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: CallSet, + _call_set_id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CallsetPatchCall<'a, C, A> {} + +impl<'a, C, A> CallsetPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CallSet)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.callsets.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("callSetId", self._call_set_id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "callSetId", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/callsets/{callSetId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{callSetId}", "callSetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["callSetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CallSet) -> CallsetPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the call set to be updated. + /// + /// Sets the *call set id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn call_set_id(mut self, new_value: &str) -> CallsetPatchCall<'a, C, A> { + self._call_set_id = new_value.to_string(); + self + } + /// An optional mask specifying which fields to update. At this time, the only mutable field is [name][google.genomics.v1.CallSet.name]. The only acceptable value is "name". If unspecified, all mutable fields will be updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> CallsetPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> CallsetPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> CallsetPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> CallsetPatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates a new call set. +/// +/// A builder for the *create* method supported by a *callset* resource. +/// It is not used directly, but through a `CallsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::CallSet; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CallSet::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.callsets().create(req) +/// .doit(); +/// # } +/// ``` +pub struct CallsetCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: CallSet, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CallsetCreateCall<'a, C, A> {} + +impl<'a, C, A> CallsetCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CallSet)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.callsets.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/callsets".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CallSet) -> CallsetCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> CallsetCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> CallsetCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> CallsetCreateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Deletes a call set. +/// +/// A builder for the *delete* method supported by a *callset* resource. +/// It is not used directly, but through a `CallsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.callsets().delete("callSetId") +/// .doit(); +/// # } +/// ``` +pub struct CallsetDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _call_set_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CallsetDeleteCall<'a, C, A> {} + +impl<'a, C, A> CallsetDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.callsets.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("callSetId", self._call_set_id.to_string())); + for &field in ["alt", "callSetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/callsets/{callSetId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{callSetId}", "callSetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["callSetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the call set to be deleted. + /// + /// Sets the *call set id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn call_set_id(mut self, new_value: &str) -> CallsetDeleteCall<'a, C, A> { + self._call_set_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> CallsetDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> CallsetDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> CallsetDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a call set by ID. +/// +/// A builder for the *get* method supported by a *callset* resource. +/// It is not used directly, but through a `CallsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.callsets().get("callSetId") +/// .doit(); +/// # } +/// ``` +pub struct CallsetGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _call_set_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CallsetGetCall<'a, C, A> {} + +impl<'a, C, A> CallsetGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CallSet)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.callsets.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("callSetId", self._call_set_id.to_string())); + for &field in ["alt", "callSetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/callsets/{callSetId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{callSetId}", "callSetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["callSetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the call set. + /// + /// Sets the *call set id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn call_set_id(mut self, new_value: &str) -> CallsetGetCall<'a, C, A> { + self._call_set_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> CallsetGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> CallsetGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> CallsetGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a list of reads for one or more read group sets. Reads search operates over a genomic coordinate space of reference sequence & position defined over the reference sequences to which the requested read group sets are aligned. If a target positional range is specified, search returns all reads whose alignment to the reference genome overlap the range. A query which specifies only read group set IDs yields all reads in those read group sets, including unmapped reads. All reads returned (including reads on subsequent pages) are ordered by genomic coordinate (reference sequence & position). Reads with equivalent genomic coordinates are returned in a deterministic order. Implements [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85). +/// +/// A builder for the *search* method supported by a *read* resource. +/// It is not used directly, but through a `ReadMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::SearchReadsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SearchReadsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.reads().search(req) +/// .doit(); +/// # } +/// ``` +pub struct ReadSearchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: SearchReadsRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReadSearchCall<'a, C, A> {} + +impl<'a, C, A> ReadSearchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SearchReadsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.reads.search", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/reads/search".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SearchReadsRequest) -> ReadSearchCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReadSearchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ReadSearchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReadSearchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Exports a read group set to a BAM file in Google Cloud Storage. Note that currently there may be some differences between exported BAM files and the original BAM file at the time of import. In particular, comments in the input file header will not be preserved, some custom tags will be converted to strings, and original reference sequence order is not necessarily preserved. +/// +/// A builder for the *export* method supported by a *readgroupset* resource. +/// It is not used directly, but through a `ReadgroupsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::ExportReadGroupSetRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ExportReadGroupSetRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.readgroupsets().export(req, "readGroupSetId") +/// .doit(); +/// # } +/// ``` +pub struct ReadgroupsetExportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: ExportReadGroupSetRequest, + _read_group_set_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReadgroupsetExportCall<'a, C, A> {} + +impl<'a, C, A> ReadgroupsetExportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.readgroupsets.export", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("readGroupSetId", self._read_group_set_id.to_string())); + for &field in ["alt", "readGroupSetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/readgroupsets/{readGroupSetId}:export".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{readGroupSetId}", "readGroupSetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["readGroupSetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ExportReadGroupSetRequest) -> ReadgroupsetExportCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The ID of the read group set to export. + /// + /// Sets the *read group set id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn read_group_set_id(mut self, new_value: &str) -> ReadgroupsetExportCall<'a, C, A> { + self._read_group_set_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReadgroupsetExportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ReadgroupsetExportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReadgroupsetExportCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates read group sets by asynchronously importing the provided information. Note that currently comments in the input file header are **not** imported and some custom tags will be converted to strings, rather than preserving tag types. The caller must have WRITE permissions to the dataset. +/// +/// A builder for the *import* method supported by a *readgroupset* resource. +/// It is not used directly, but through a `ReadgroupsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::ImportReadGroupSetsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ImportReadGroupSetsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.readgroupsets().import(req) +/// .doit(); +/// # } +/// ``` +pub struct ReadgroupsetImportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: ImportReadGroupSetsRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReadgroupsetImportCall<'a, C, A> {} + +impl<'a, C, A> ReadgroupsetImportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.readgroupsets.import", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/readgroupsets:import".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ImportReadGroupSetsRequest) -> ReadgroupsetImportCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReadgroupsetImportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ReadgroupsetImportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReadgroupsetImportCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates a read group set. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *readgroupset* resource. +/// It is not used directly, but through a `ReadgroupsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::ReadGroupSet; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ReadGroupSet::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.readgroupsets().patch(req, "readGroupSetId") +/// .update_mask("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ReadgroupsetPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: ReadGroupSet, + _read_group_set_id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReadgroupsetPatchCall<'a, C, A> {} + +impl<'a, C, A> ReadgroupsetPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ReadGroupSet)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.readgroupsets.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("readGroupSetId", self._read_group_set_id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "readGroupSetId", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/readgroupsets/{readGroupSetId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{readGroupSetId}", "readGroupSetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["readGroupSetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ReadGroupSet) -> ReadgroupsetPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set. + /// + /// Sets the *read group set id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn read_group_set_id(mut self, new_value: &str) -> ReadgroupsetPatchCall<'a, C, A> { + self._read_group_set_id = new_value.to_string(); + self + } + /// An optional mask specifying which fields to update. At this time, mutable fields are [referenceSetId][google.genomics.v1.ReadGroupSet.reference_set_id] and [name][google.genomics.v1.ReadGroupSet.name]. Acceptable values are "referenceSetId" and "name". If unspecified, all mutable fields will be updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ReadgroupsetPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReadgroupsetPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ReadgroupsetPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReadgroupsetPatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists fixed width coverage buckets for a read group set, each of which correspond to a range of a reference sequence. Each bucket summarizes coverage information across its corresponding genomic range. Coverage is defined as the number of reads which are aligned to a given base in the reference sequence. Coverage buckets are available at several precomputed bucket widths, enabling retrieval of various coverage 'zoom levels'. The caller must have READ permissions for the target read group set. +/// +/// A builder for the *coveragebuckets.list* method supported by a *readgroupset* resource. +/// It is not used directly, but through a `ReadgroupsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.readgroupsets().coveragebuckets_list("readGroupSetId") +/// .target_bucket_width("Lorem") +/// .start("eos") +/// .reference_name("erat") +/// .page_token("sadipscing") +/// .page_size(-48) +/// .end("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct ReadgroupsetCoveragebucketListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _read_group_set_id: String, + _target_bucket_width: Option, + _start: Option, + _reference_name: Option, + _page_token: Option, + _page_size: Option, + _end: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReadgroupsetCoveragebucketListCall<'a, C, A> {} + +impl<'a, C, A> ReadgroupsetCoveragebucketListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListCoverageBucketsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.readgroupsets.coveragebuckets.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + params.push(("readGroupSetId", self._read_group_set_id.to_string())); + if let Some(value) = self._target_bucket_width { + params.push(("targetBucketWidth", value.to_string())); + } + if let Some(value) = self._start { + params.push(("start", value.to_string())); + } + if let Some(value) = self._reference_name { + params.push(("referenceName", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._end { + params.push(("end", value.to_string())); + } + for &field in ["alt", "readGroupSetId", "targetBucketWidth", "start", "referenceName", "pageToken", "pageSize", "end"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/readgroupsets/{readGroupSetId}/coveragebuckets".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{readGroupSetId}", "readGroupSetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["readGroupSetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The ID of the read group set over which coverage is requested. + /// + /// Sets the *read group set id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn read_group_set_id(mut self, new_value: &str) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { + self._read_group_set_id = new_value.to_string(); + self + } + /// The desired width of each reported coverage bucket in base pairs. This will be rounded down to the nearest precomputed bucket width; the value of which is returned as `bucketWidth` in the response. Defaults to infinity (each bucket spans an entire reference sequence) or the length of the target range, if specified. The smallest precomputed `bucketWidth` is currently 2048 base pairs; this is subject to change. + /// + /// Sets the *target bucket width* query property to the given value. + pub fn target_bucket_width(mut self, new_value: &str) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { + self._target_bucket_width = Some(new_value.to_string()); + self + } + /// The start position of the range on the reference, 0-based inclusive. If specified, `referenceName` must also be specified. Defaults to 0. + /// + /// Sets the *start* query property to the given value. + pub fn start(mut self, new_value: &str) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { + self._start = Some(new_value.to_string()); + self + } + /// The name of the reference to query, within the reference set associated with this query. Optional. + /// + /// Sets the *reference name* query property to the given value. + pub fn reference_name(mut self, new_value: &str) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { + self._reference_name = Some(new_value.to_string()); + self + } + /// 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. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of results to return in a single page. If unspecified, defaults to 1024. The maximum value is 2048. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The end position of the range on the reference, 0-based exclusive. If specified, `referenceName` must also be specified. If unset or 0, defaults to the length of the reference. + /// + /// Sets the *end* query property to the given value. + pub fn end(mut self, new_value: &str) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { + self._end = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ReadgroupsetCoveragebucketListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReadgroupsetCoveragebucketListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Deletes a read group set. +/// +/// A builder for the *delete* method supported by a *readgroupset* resource. +/// It is not used directly, but through a `ReadgroupsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.readgroupsets().delete("readGroupSetId") +/// .doit(); +/// # } +/// ``` +pub struct ReadgroupsetDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _read_group_set_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReadgroupsetDeleteCall<'a, C, A> {} + +impl<'a, C, A> ReadgroupsetDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.readgroupsets.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("readGroupSetId", self._read_group_set_id.to_string())); + for &field in ["alt", "readGroupSetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/readgroupsets/{readGroupSetId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{readGroupSetId}", "readGroupSetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["readGroupSetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the read group set to be deleted. The caller must have WRITE permissions to the dataset associated with this read group set. + /// + /// Sets the *read group set id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn read_group_set_id(mut self, new_value: &str) -> ReadgroupsetDeleteCall<'a, C, A> { + self._read_group_set_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReadgroupsetDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ReadgroupsetDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReadgroupsetDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Searches for read group sets matching the criteria. Implements [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135). +/// +/// A builder for the *search* method supported by a *readgroupset* resource. +/// It is not used directly, but through a `ReadgroupsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::SearchReadGroupSetsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SearchReadGroupSetsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.readgroupsets().search(req) +/// .doit(); +/// # } +/// ``` +pub struct ReadgroupsetSearchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: SearchReadGroupSetsRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReadgroupsetSearchCall<'a, C, A> {} + +impl<'a, C, A> ReadgroupsetSearchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SearchReadGroupSetsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.readgroupsets.search", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/readgroupsets/search".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SearchReadGroupSetsRequest) -> ReadgroupsetSearchCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReadgroupsetSearchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ReadgroupsetSearchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReadgroupsetSearchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a read group set by ID. +/// +/// A builder for the *get* method supported by a *readgroupset* resource. +/// It is not used directly, but through a `ReadgroupsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.readgroupsets().get("readGroupSetId") +/// .doit(); +/// # } +/// ``` +pub struct ReadgroupsetGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _read_group_set_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReadgroupsetGetCall<'a, C, A> {} + +impl<'a, C, A> ReadgroupsetGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ReadGroupSet)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.readgroupsets.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("readGroupSetId", self._read_group_set_id.to_string())); + for &field in ["alt", "readGroupSetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/readgroupsets/{readGroupSetId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{readGroupSetId}", "readGroupSetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["readGroupSetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the read group set. + /// + /// Sets the *read group set id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn read_group_set_id(mut self, new_value: &str) -> ReadgroupsetGetCall<'a, C, A> { + self._read_group_set_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReadgroupsetGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ReadgroupsetGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReadgroupsetGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists the bases in a reference, optionally restricted to a range. Implements [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221). +/// +/// A builder for the *bases.list* method supported by a *reference* resource. +/// It is not used directly, but through a `ReferenceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.references().bases_list("referenceId") +/// .start("labore") +/// .page_token("eirmod") +/// .page_size(-33) +/// .end("invidunt") +/// .doit(); +/// # } +/// ``` +pub struct ReferenceBaseListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _reference_id: String, + _start: Option, + _page_token: Option, + _page_size: Option, + _end: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReferenceBaseListCall<'a, C, A> {} + +impl<'a, C, A> ReferenceBaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListBasesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.references.bases.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("referenceId", self._reference_id.to_string())); + if let Some(value) = self._start { + params.push(("start", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._end { + params.push(("end", value.to_string())); + } + for &field in ["alt", "referenceId", "start", "pageToken", "pageSize", "end"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/references/{referenceId}/bases".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{referenceId}", "referenceId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["referenceId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the reference. + /// + /// Sets the *reference id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn reference_id(mut self, new_value: &str) -> ReferenceBaseListCall<'a, C, A> { + self._reference_id = new_value.to_string(); + self + } + /// The start position (0-based) of this query. Defaults to 0. + /// + /// Sets the *start* query property to the given value. + pub fn start(mut self, new_value: &str) -> ReferenceBaseListCall<'a, C, A> { + self._start = Some(new_value.to_string()); + self + } + /// 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. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ReferenceBaseListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Specifies the maximum number of bases to return in a single page. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ReferenceBaseListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The end position (0-based, exclusive) of this query. Defaults to the length of this reference. + /// + /// Sets the *end* query property to the given value. + pub fn end(mut self, new_value: &str) -> ReferenceBaseListCall<'a, C, A> { + self._end = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReferenceBaseListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ReferenceBaseListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReferenceBaseListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Searches for references which match the given criteria. Implements [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146). +/// +/// A builder for the *search* method supported by a *reference* resource. +/// It is not used directly, but through a `ReferenceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::SearchReferencesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SearchReferencesRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.references().search(req) +/// .doit(); +/// # } +/// ``` +pub struct ReferenceSearchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: SearchReferencesRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReferenceSearchCall<'a, C, A> {} + +impl<'a, C, A> ReferenceSearchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SearchReferencesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.references.search", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/references/search".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SearchReferencesRequest) -> ReferenceSearchCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReferenceSearchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ReferenceSearchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReferenceSearchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a reference. Implements [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158). +/// +/// A builder for the *get* method supported by a *reference* resource. +/// It is not used directly, but through a `ReferenceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.references().get("referenceId") +/// .doit(); +/// # } +/// ``` +pub struct ReferenceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _reference_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReferenceGetCall<'a, C, A> {} + +impl<'a, C, A> ReferenceGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Reference)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.references.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("referenceId", self._reference_id.to_string())); + for &field in ["alt", "referenceId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/references/{referenceId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{referenceId}", "referenceId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["referenceId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the reference. + /// + /// Sets the *reference id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn reference_id(mut self, new_value: &str) -> ReferenceGetCall<'a, C, A> { + self._reference_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReferenceGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ReferenceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReferenceGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a list of variants matching the criteria. Implements [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126). +/// +/// A builder for the *search* method supported by a *variant* resource. +/// It is not used directly, but through a `VariantMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::SearchVariantsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SearchVariantsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variants().search(req) +/// .doit(); +/// # } +/// ``` +pub struct VariantSearchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: SearchVariantsRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantSearchCall<'a, C, A> {} + +impl<'a, C, A> VariantSearchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SearchVariantsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variants.search", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variants/search".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SearchVariantsRequest) -> VariantSearchCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantSearchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VariantSearchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantSearchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Deletes a variant. +/// +/// A builder for the *delete* method supported by a *variant* resource. +/// It is not used directly, but through a `VariantMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variants().delete("variantId") +/// .doit(); +/// # } +/// ``` +pub struct VariantDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _variant_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantDeleteCall<'a, C, A> {} + +impl<'a, C, A> VariantDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variants.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("variantId", self._variant_id.to_string())); + for &field in ["alt", "variantId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variants/{variantId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{variantId}", "variantId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["variantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the variant to be deleted. + /// + /// Sets the *variant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn variant_id(mut self, new_value: &str) -> VariantDeleteCall<'a, C, A> { + self._variant_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VariantDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a variant by ID. +/// +/// A builder for the *get* method supported by a *variant* resource. +/// It is not used directly, but through a `VariantMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variants().get("variantId") +/// .doit(); +/// # } +/// ``` +pub struct VariantGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _variant_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantGetCall<'a, C, A> {} + +impl<'a, C, A> VariantGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Variant)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variants.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("variantId", self._variant_id.to_string())); + for &field in ["alt", "variantId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variants/{variantId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{variantId}", "variantId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["variantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the variant. + /// + /// Sets the *variant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn variant_id(mut self, new_value: &str) -> VariantGetCall<'a, C, A> { + self._variant_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VariantGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Merges the given variants with existing variants. Each variant will be merged with an existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant, and other fields (such as key/value pairs) are discarded. +/// +/// A builder for the *merge* method supported by a *variant* resource. +/// It is not used directly, but through a `VariantMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::MergeVariantsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = MergeVariantsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variants().merge(req) +/// .doit(); +/// # } +/// ``` +pub struct VariantMergeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: MergeVariantsRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantMergeCall<'a, C, A> {} + +impl<'a, C, A> VariantMergeCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variants.merge", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variants:merge".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: MergeVariantsRequest) -> VariantMergeCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantMergeCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VariantMergeCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantMergeCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates a new variant. +/// +/// A builder for the *create* method supported by a *variant* resource. +/// It is not used directly, but through a `VariantMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::Variant; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Variant::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variants().create(req) +/// .doit(); +/// # } +/// ``` +pub struct VariantCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: Variant, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantCreateCall<'a, C, A> {} + +impl<'a, C, A> VariantCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Variant)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variants.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variants".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Variant) -> VariantCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VariantCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantCreateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates variant data by asynchronously importing the provided information. The variants for import will be merged with any existing data and each other according to the behavior of mergeVariants. In particular, this means for merged VCF variants that have conflicting INFO fields, some data will be arbitrarily discarded. As a special case, for single-sample VCF files, QUAL and FILTER fields will be moved to the call level; these are sometimes interpreted in a call-specific context. Imported VCF headers are appended to the metadata already in a variant set. +/// +/// A builder for the *import* method supported by a *variant* resource. +/// It is not used directly, but through a `VariantMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::ImportVariantsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ImportVariantsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variants().import(req) +/// .doit(); +/// # } +/// ``` +pub struct VariantImportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: ImportVariantsRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantImportCall<'a, C, A> {} + +impl<'a, C, A> VariantImportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variants.import", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variants:import".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ImportVariantsRequest) -> VariantImportCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantImportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VariantImportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantImportCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates a variant. This method supports patch semantics. Returns the modified variant without its calls. +/// +/// A builder for the *patch* method supported by a *variant* resource. +/// It is not used directly, but through a `VariantMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::Variant; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Variant::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variants().patch(req, "variantId") +/// .update_mask("et") +/// .doit(); +/// # } +/// ``` +pub struct VariantPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: Variant, + _variant_id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantPatchCall<'a, C, A> {} + +impl<'a, C, A> VariantPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Variant)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variants.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("variantId", self._variant_id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "variantId", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variants/{variantId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{variantId}", "variantId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["variantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Variant) -> VariantPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the variant to be updated. + /// + /// Sets the *variant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn variant_id(mut self, new_value: &str) -> VariantPatchCall<'a, C, A> { + self._variant_id = new_value.to_string(); + self + } + /// An optional mask specifying which fields to update. At this time, mutable fields are [names][google.genomics.v1.Variant.names] and [info][google.genomics.v1.Variant.info]. Acceptable values are "names" and "info". If unspecified, all mutable fields will be updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> VariantPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VariantPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantPatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates a new variant set. +/// +/// A builder for the *create* method supported by a *variantset* resource. +/// It is not used directly, but through a `VariantsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::VariantSet; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = VariantSet::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variantsets().create(req) +/// .doit(); +/// # } +/// ``` +pub struct VariantsetCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: VariantSet, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantsetCreateCall<'a, C, A> {} + +impl<'a, C, A> VariantsetCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, VariantSet)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variantsets.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variantsets".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: VariantSet) -> VariantsetCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantsetCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VariantsetCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantsetCreateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Exports variant set data to an external destination. +/// +/// A builder for the *export* method supported by a *variantset* resource. +/// It is not used directly, but through a `VariantsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::ExportVariantSetRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ExportVariantSetRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variantsets().export(req, "variantSetId") +/// .doit(); +/// # } +/// ``` +pub struct VariantsetExportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: ExportVariantSetRequest, + _variant_set_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantsetExportCall<'a, C, A> {} + +impl<'a, C, A> VariantsetExportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variantsets.export", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("variantSetId", self._variant_set_id.to_string())); + for &field in ["alt", "variantSetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variantsets/{variantSetId}:export".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{variantSetId}", "variantSetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["variantSetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ExportVariantSetRequest) -> VariantsetExportCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The ID of the variant set that contains variant data which should be exported. The caller must have READ access to this variant set. + /// + /// Sets the *variant set id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn variant_set_id(mut self, new_value: &str) -> VariantsetExportCall<'a, C, A> { + self._variant_set_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantsetExportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VariantsetExportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Bigquery`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantsetExportCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates a variant set. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *variantset* resource. +/// It is not used directly, but through a `VariantsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::VariantSet; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = VariantSet::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variantsets().patch(req, "variantSetId") +/// .update_mask("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct VariantsetPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: VariantSet, + _variant_set_id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantsetPatchCall<'a, C, A> {} + +impl<'a, C, A> VariantsetPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, VariantSet)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variantsets.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("variantSetId", self._variant_set_id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "variantSetId", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variantsets/{variantSetId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{variantSetId}", "variantSetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["variantSetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: VariantSet) -> VariantsetPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the variant to be updated (must already exist). + /// + /// Sets the *variant set id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn variant_set_id(mut self, new_value: &str) -> VariantsetPatchCall<'a, C, A> { + self._variant_set_id = new_value.to_string(); + self + } + /// An optional mask specifying which fields to update. At this time, the only mutable field is [metadata][google.genomics.v1.VariantSet.metadata]. The only acceptable value is "metadata". If unspecified, all mutable fields will be updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> VariantsetPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantsetPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VariantsetPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantsetPatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns a list of all variant sets matching search criteria. Implements [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49). +/// +/// A builder for the *search* method supported by a *variantset* resource. +/// It is not used directly, but through a `VariantsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::SearchVariantSetsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SearchVariantSetsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variantsets().search(req) +/// .doit(); +/// # } +/// ``` +pub struct VariantsetSearchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: SearchVariantSetsRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantsetSearchCall<'a, C, A> {} + +impl<'a, C, A> VariantsetSearchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SearchVariantSetsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variantsets.search", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variantsets/search".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SearchVariantSetsRequest) -> VariantsetSearchCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantsetSearchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VariantsetSearchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantsetSearchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a variant set by ID. +/// +/// A builder for the *get* method supported by a *variantset* resource. +/// It is not used directly, but through a `VariantsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variantsets().get("variantSetId") +/// .doit(); +/// # } +/// ``` +pub struct VariantsetGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _variant_set_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantsetGetCall<'a, C, A> {} + +impl<'a, C, A> VariantsetGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, VariantSet)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variantsets.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("variantSetId", self._variant_set_id.to_string())); + for &field in ["alt", "variantSetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variantsets/{variantSetId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{variantSetId}", "variantSetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["variantSetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The ID of the variant set. + /// + /// Sets the *variant set id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn variant_set_id(mut self, new_value: &str) -> VariantsetGetCall<'a, C, A> { + self._variant_set_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantsetGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VariantsetGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantsetGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Deletes the contents of a variant set. The variant set object is not deleted. +/// +/// A builder for the *delete* method supported by a *variantset* resource. +/// It is not used directly, but through a `VariantsetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variantsets().delete("variantSetId") +/// .doit(); +/// # } +/// ``` +pub struct VariantsetDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _variant_set_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantsetDeleteCall<'a, C, A> {} + +impl<'a, C, A> VariantsetDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variantsets.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("variantSetId", self._variant_set_id.to_string())); + for &field in ["alt", "variantSetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variantsets/{variantSetId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{variantSetId}", "variantSetId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["variantSetId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the variant set to be deleted. + /// + /// Sets the *variant set id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn variant_set_id(mut self, new_value: &str) -> VariantsetDeleteCall<'a, C, A> { + self._variant_set_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantsetDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - 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. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> VariantsetDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantsetDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + +