diff --git a/etc/api/adexchangebuyer/v1.2/adexchangebuyer-api.json b/etc/api/adexchangebuyer/v1.2/adexchangebuyer-api.json index 20cdf13597..d244417311 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/wrqAKwp6S3TrJmyaUelgRJAKaL0\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/B9as-vwOS9AM116cSm-3C_gic94\"", "discoveryVersion": "v1", "id": "adexchangebuyer:v1.2", "name": "adexchangebuyer", "canonicalName": "Ad Exchange Buyer", "version": "v1.2", - "revision": "20150326", + "revision": "20150520", "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 434369f3f8..e4c8ea2e25 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/LngzzVwqv1YJhBSD4vnWK91Oc64\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ekf6O2lwsP92coEGgGA2ge5cRGA\"", "discoveryVersion": "v1", "id": "adexchangebuyer:v1.3", "name": "adexchangebuyer", "canonicalName": "Ad Exchange Buyer", "version": "v1.3", - "revision": "20150326", + "revision": "20150520", "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", @@ -555,6 +555,16 @@ "type": "object", "description": "The configuration data for an Ad Exchange performance report list.", "properties": { + "bidRate": { + "type": "number", + "description": "The number of bid responses with an ad.", + "format": "double" + }, + "bidRequestRate": { + "type": "number", + "description": "The number of bid requests sent to your bidder.", + "format": "double" + }, "calloutStatusRate": { "type": "array", "description": "Rate of various prefiltering statuses per match. Please refer to the callout-status-codes.txt file for different statuses.", @@ -576,6 +586,11 @@ "type": "any" } }, + "filteredBidRate": { + "type": "number", + "description": "The number of bid responses that were filtered due to a policy violation or other errors.", + "format": "double" + }, "hostedMatchStatusRate": { "type": "array", "description": "Average QPS for hosted match operations.", @@ -583,6 +598,11 @@ "type": "any" } }, + "inventoryMatchRate": { + "type": "number", + "description": "The number of potential queries based on your pretargeting settings.", + "format": "double" + }, "kind": { "type": "string", "description": "Resource type.", @@ -637,10 +657,20 @@ "type": "string", "description": "The trading location of this data." }, + "successfulRequestRate": { + "type": "number", + "description": "The number of properly formed bid responses received by our servers within the deadline.", + "format": "double" + }, "timestamp": { "type": "string", "description": "The unix timestamp of the starting time of this performance data.", "format": "int64" + }, + "unsuccessfulRequestRate": { + "type": "number", + "description": "The number of bid responses that were unsuccessful due to timeouts, incorrect formatting, etc.", + "format": "double" } } }, diff --git a/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json b/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json index de74eb82c7..0a772dc71a 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/6vQ6WcvWBcSrIzCtvKNZUqusPLs\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/GvYt66UFqsD2lyh6__RT4TIfEpw\"", "discoveryVersion": "v1", "id": "adexchangeseller:v1.1", "name": "adexchangeseller", "canonicalName": "Ad Exchange Seller", "version": "v1.1", - "revision": "20150326", + "revision": "20150617", "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 dce102bf02..52aaca1fcd 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/HIanjeE4JLXZb-5xFk00Kh9TaQw\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/lIr0o2X-yT10aIbPZZWXwQ6eaxg\"", "discoveryVersion": "v1", "id": "adexchangeseller:v1", "name": "adexchangeseller", "canonicalName": "Ad Exchange Seller", "version": "v1", - "revision": "20150326", + "revision": "20150617", "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 d83897dd41..8e9200a902 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/mbApDmuYlCUR9wtUe1xDG4XNMoU\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/c8b314M2iOuvSH6U9ZroqWZwQl4\"", "discoveryVersion": "v1", "id": "adexchangeseller:v2.0", "name": "adexchangeseller", "canonicalName": "Ad Exchange Seller", "version": "v2.0", - "revision": "20150326", + "revision": "20150617", "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/admin/directory_v1/admin-api.json b/etc/api/admin/directory_v1/admin-api.json index f4b49d1b3c..8289fdd5d0 100644 --- a/etc/api/admin/directory_v1/admin-api.json +++ b/etc/api/admin/directory_v1/admin-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Gkp35yY2tnMjjfSgryNCrENSB-w\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/QlXkTp8arWMqhMMilmdrbkzNu_E\"", "discoveryVersion": "v1", "id": "admin:directory_v1", "name": "admin", "canonicalName": "directory", "version": "directory_v1", - "revision": "20150314", + "revision": "20150326", "title": "Admin Directory API", "description": "The Admin SDK Directory API lets you view and manage enterprise resources such as users and groups, administrative notifications, security features, and more.", "ownerDomain": "google.com", @@ -1304,6 +1304,10 @@ "type": "string", "description": "Suspension reason if user is suspended (Read-only)" }, + "thumbnailPhotoEtag": { + "type": "string", + "description": "ETag of the user's photo (Read-only)" + }, "thumbnailPhotoUrl": { "type": "string", "description": "Photo Url of the user (Read-only)" diff --git a/etc/api/admin/reports_v1/admin-api.json b/etc/api/admin/reports_v1/admin-api.json index 00cda983f4..02fad8fc14 100644 --- a/etc/api/admin/reports_v1/admin-api.json +++ b/etc/api/admin/reports_v1/admin-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/njJ20axdk4gjPFCACIGtkJPulr8\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/SE8GF0qL6iXnRUtOo9FTFK7DuNM\"", "discoveryVersion": "v1", "id": "admin:reports_v1", "name": "admin", "canonicalName": "reports", "version": "reports_v1", - "revision": "20150115", + "revision": "20150429", "title": "Admin Reports API", "description": "Allows the administrators of Google Apps customers to fetch reports about the usage, collaboration, security and risk for their users.", "ownerDomain": "google.com", @@ -464,7 +464,7 @@ "type": "string", "description": "Application name for which the events are to be retrieved.", "required": true, - "pattern": "(admin)|(calendar)|(docs)|(drive)|(login)|(token)", + "pattern": "(admin)|(calendar)|(drive)|(login)|(token)", "location": "path" }, "customerId": { @@ -543,7 +543,7 @@ "type": "string", "description": "Application name for which the events are to be retrieved.", "required": true, - "pattern": "(admin)|(calendar)|(docs)|(drive)|(login)|(token)", + "pattern": "(admin)|(calendar)|(drive)|(login)|(token)", "location": "path" }, "customerId": { diff --git a/etc/api/adsense/v1.2/adsense-api.json b/etc/api/adsense/v1.2/adsense-api.json index 1642ffbc3a..a85ec07563 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/7gZYkcPpV3s02wAJVoj7NlIJW6w\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/z7MA4Sf83xk94dcPThuFIYyVJEo\"", "discoveryVersion": "v1", "id": "adsense:v1.2", "name": "adsense", "canonicalName": "AdSense", "version": "v1.2", - "revision": "20150326", + "revision": "20150617", "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 67749250e1..0c59d5d1cb 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/hueeQy4QOubnDczOyF4h1PQAZ-8\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/zXyQdMUcVqU3jX8pCYi1fmxl-ZE\"", "discoveryVersion": "v1", "id": "adsense:v1.3", "name": "adsense", "canonicalName": "AdSense", "version": "v1.3", - "revision": "20150326", + "revision": "20150617", "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 66e5186d0a..60d7ba0344 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/GpbxOnnTq3hIpQS9CX4GHqR4YAY\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/UqvhrXgnTT9NcqAeBIivKsxHP9E\"", "discoveryVersion": "v1", "id": "adsense:v1.4", "name": "adsense", "canonicalName": "AdSense", "version": "v1.4", - "revision": "20150326", + "revision": "20150617", "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 6fc53e8011..12e931b7dd 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/n8NTNQVEaYwqoUTL8SFLpUB6Wtk\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/PXi2YxruQPyOx7csXScLsx5SoZs\"", "discoveryVersion": "v1", "id": "adsensehost:v4.1", "name": "adsensehost", "canonicalName": "AdSense Host", "version": "v4.1", - "revision": "20150307", + "revision": "20150617", "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/analytics/v2.4/analytics-api.json b/etc/api/analytics/v2.4/analytics-api.json index 4716d39fd2..e658c2b9d4 100644 --- a/etc/api/analytics/v2.4/analytics-api.json +++ b/etc/api/analytics/v2.4/analytics-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/jnLvY1FFNrvhkzc3-yHcZWw_dyc\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/cpEq1c7PEyDZhPuN1RpuZQasQqE\"", "discoveryVersion": "v1", "id": "analytics:v2.4", "name": "analytics", "version": "v2.4", - "revision": "20150305", + "revision": "20150417", "title": "Google Analytics API", "description": "View and manage your Google Analytics data", "ownerDomain": "google.com", diff --git a/etc/api/analytics/v3/analytics-api.json b/etc/api/analytics/v3/analytics-api.json index 4b151ceb87..8b24794642 100644 --- a/etc/api/analytics/v3/analytics-api.json +++ b/etc/api/analytics/v3/analytics-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/pk8iT1cgG258NxPsYV-x-iX1AL8\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/DBMpwoPoBbdea-3gvvfC6pL3VKM\"", "discoveryVersion": "v1", "id": "analytics:v3", "name": "analytics", "version": "v3", - "revision": "20150305", + "revision": "20150417", "title": "Google Analytics API", "description": "View and manage your Google Analytics data", "ownerDomain": "google.com", @@ -1288,6 +1288,11 @@ "type": "string", "description": "Field A." }, + "fieldAIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION.", + "format": "int32" + }, "fieldARequired": { "type": "boolean", "description": "Indicates if field A is required to match." @@ -1296,6 +1301,11 @@ "type": "string", "description": "Field B." }, + "fieldBIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION.", + "format": "int32" + }, "fieldBRequired": { "type": "boolean", "description": "Indicates if field B is required to match." @@ -1308,6 +1318,11 @@ "type": "string", "description": "Output field." }, + "outputToFieldIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION.", + "format": "int32" + }, "overrideOutputField": { "type": "boolean", "description": "Indicates if the existing value of the output field, if any, should be overridden by the output expression." @@ -1345,6 +1360,11 @@ "field": { "type": "string", "description": "Field to use in the filter." + }, + "fieldIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION.", + "format": "int32" } } }, @@ -1385,6 +1405,11 @@ "type": "string", "description": "Field to use in the filter." }, + "fieldIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION.", + "format": "int32" + }, "replaceString": { "type": "string", "description": "Term to replace the search term with." @@ -1423,6 +1448,11 @@ "field": { "type": "string", "description": "Field to use in the filter." + }, + "fieldIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION.", + "format": "int32" } } } @@ -1443,7 +1473,12 @@ }, "field": { "type": "string", - "description": "Field to filter. Possible values: \n- Content and Traffic \n- PAGE_REQUEST_URI, \n- PAGE_HOSTNAME, \n- PAGE_TITLE, \n- REFERRAL, \n- COST_DATA_URI (Campaign target URL), \n- HIT_TYPE, \n- INTERNAL_SEARCH_TERM, \n- INTERNAL_SEARCH_TYPE, \n- SOURCE_PROPERTY_TRACKING_ID, \n- Campaign or AdGroup \n- CAMPAIGN_SOURCE, \n- CAMPAIGN_MEDIUM, \n- CAMPAIGN_NAME, \n- CAMPAIGN_AD_GROUP, \n- CAMPAIGN_TERM, \n- CAMPAIGN_CONTENT, \n- CAMPAIGN_CODE, \n- CAMPAIGN_REFERRAL_PATH, \n- E-Commerce \n- TRANSACTION_COUNTRY, \n- TRANSACTION_REGION, \n- TRANSACTION_CITY, \n- TRANSACTION_AFFILIATION (Store or order location), \n- ITEM_NAME, \n- ITEM_CODE, \n- ITEM_VARIATION, \n- TRANSACTION_ID, \n- TRANSACTION_CURRENCY_CODE, \n- PRODUCT_ACTION_TYPE, \n- Audience/Users \n- BROWSER, \n- BROWSER_VERSION, \n- BROWSER_SIZE, \n- PLATFORM, \n- PLATFORM_VERSION, \n- LANGUAGE, \n- SCREEN_RESOLUTION, \n- SCREEN_COLORS, \n- JAVA_ENABLED (Boolean Field), \n- FLASH_VERSION, \n- GEO_SPEED (Connection speed), \n- VISITOR_TYPE, \n- GEO_ORGANIZATION (ISP organization), \n- GEO_DOMAIN, \n- GEO_IP_ADDRESS, \n- GEO_IP_VERSION, \n- Location \n- GEO_COUNTRY, \n- GEO_REGION, \n- GEO_CITY, \n- Event \n- EVENT_CATEGORY, \n- EVENT_ACTION, \n- EVENT_LABEL, \n- Other \n- CUSTOM_FIELD_1, \n- CUSTOM_FIELD_2, \n- USER_DEFINED_VALUE, \n- Application \n- APP_ID, \n- APP_INSTALLER_ID, \n- APP_NAME, \n- APP_VERSION, \n- SCREEN, \n- IS_APP (Boolean Field), \n- IS_FATAL_EXCEPTION (Boolean Field), \n- EXCEPTION_DESCRIPTION, \n- Mobile device \n- IS_MOBILE (Boolean Field, Deprecated. Use DEVICE_CATEGORY=mobile), \n- IS_TABLET (Boolean Field, Deprecated. Use DEVICE_CATEGORY=tablet), \n- DEVICE_CATEGORY, \n- MOBILE_HAS_QWERTY_KEYBOARD (Boolean Field), \n- MOBILE_HAS_NFC_SUPPORT (Boolean Field), \n- MOBILE_HAS_CELLULAR_RADIO (Boolean Field), \n- MOBILE_HAS_WIFI_SUPPORT (Boolean Field), \n- MOBILE_BRAND_NAME, \n- MOBILE_MODEL_NAME, \n- MOBILE_MARKETING_NAME, \n- MOBILE_POINTING_METHOD, \n- Social \n- SOCIAL_NETWORK, \n- SOCIAL_ACTION, \n- SOCIAL_ACTION_TARGET," + "description": "Field to filter. Possible values: \n- Content and Traffic \n- PAGE_REQUEST_URI, \n- PAGE_HOSTNAME, \n- PAGE_TITLE, \n- REFERRAL, \n- COST_DATA_URI (Campaign target URL), \n- HIT_TYPE, \n- INTERNAL_SEARCH_TERM, \n- INTERNAL_SEARCH_TYPE, \n- SOURCE_PROPERTY_TRACKING_ID, \n- Campaign or AdGroup \n- CAMPAIGN_SOURCE, \n- CAMPAIGN_MEDIUM, \n- CAMPAIGN_NAME, \n- CAMPAIGN_AD_GROUP, \n- CAMPAIGN_TERM, \n- CAMPAIGN_CONTENT, \n- CAMPAIGN_CODE, \n- CAMPAIGN_REFERRAL_PATH, \n- E-Commerce \n- TRANSACTION_COUNTRY, \n- TRANSACTION_REGION, \n- TRANSACTION_CITY, \n- TRANSACTION_AFFILIATION (Store or order location), \n- ITEM_NAME, \n- ITEM_CODE, \n- ITEM_VARIATION, \n- TRANSACTION_ID, \n- TRANSACTION_CURRENCY_CODE, \n- PRODUCT_ACTION_TYPE, \n- Audience/Users \n- BROWSER, \n- BROWSER_VERSION, \n- BROWSER_SIZE, \n- PLATFORM, \n- PLATFORM_VERSION, \n- LANGUAGE, \n- SCREEN_RESOLUTION, \n- SCREEN_COLORS, \n- JAVA_ENABLED (Boolean Field), \n- FLASH_VERSION, \n- GEO_SPEED (Connection speed), \n- VISITOR_TYPE, \n- GEO_ORGANIZATION (ISP organization), \n- GEO_DOMAIN, \n- GEO_IP_ADDRESS, \n- GEO_IP_VERSION, \n- Location \n- GEO_COUNTRY, \n- GEO_REGION, \n- GEO_CITY, \n- Event \n- EVENT_CATEGORY, \n- EVENT_ACTION, \n- EVENT_LABEL, \n- Other \n- CUSTOM_FIELD_1, \n- CUSTOM_FIELD_2, \n- USER_DEFINED_VALUE, \n- Application \n- APP_ID, \n- APP_INSTALLER_ID, \n- APP_NAME, \n- APP_VERSION, \n- SCREEN, \n- IS_APP (Boolean Field), \n- IS_FATAL_EXCEPTION (Boolean Field), \n- EXCEPTION_DESCRIPTION, \n- Mobile device \n- IS_MOBILE (Boolean Field, Deprecated. Use DEVICE_CATEGORY=mobile), \n- IS_TABLET (Boolean Field, Deprecated. Use DEVICE_CATEGORY=tablet), \n- DEVICE_CATEGORY, \n- MOBILE_HAS_QWERTY_KEYBOARD (Boolean Field), \n- MOBILE_HAS_NFC_SUPPORT (Boolean Field), \n- MOBILE_HAS_CELLULAR_RADIO (Boolean Field), \n- MOBILE_HAS_WIFI_SUPPORT (Boolean Field), \n- MOBILE_BRAND_NAME, \n- MOBILE_MODEL_NAME, \n- MOBILE_MARKETING_NAME, \n- MOBILE_POINTING_METHOD, \n- Social \n- SOCIAL_NETWORK, \n- SOCIAL_ACTION, \n- SOCIAL_ACTION_TARGET, \n- Custom dimension \n- CUSTOM_DIMENSION (See accompanying field index)," + }, + "fieldIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Set only if the field is a is CUSTOM_DIMENSION.", + "format": "int32" }, "kind": { "type": "string", diff --git a/etc/api/androidenterprise/v1/androidenterprise-api.json b/etc/api/androidenterprise/v1/androidenterprise-api.json index 25e594ea3b..a8557f9daa 100644 --- a/etc/api/androidenterprise/v1/androidenterprise-api.json +++ b/etc/api/androidenterprise/v1/androidenterprise-api.json @@ -1,13 +1,13 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/d5u0mUacj4EqZuGQlI-jqNy-2Lg\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/TAGoQX581k0pUlJRReLGRYb2z5U\"", "discoveryVersion": "v1", "id": "androidenterprise:v1", "name": "androidenterprise", "canonicalName": "Android Enterprise", "version": "v1", - "revision": "20150309", - "title": "Google Play MDM API", + "revision": "20150303", + "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", "ownerName": "Google", @@ -162,6 +162,38 @@ } } }, + "AppVersion": { + "id": "AppVersion", + "type": "object", + "description": "App version represents a single APK version.", + "properties": { + "versionCode": { + "type": "integer", + "description": "Unique increasing identifier for the apk 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\")." + } + } + }, + "ApprovalUrlInfo": { + "id": "ApprovalUrlInfo", + "type": "object", + "description": "Information on an approval URL.", + "properties": { + "approvalUrl": { + "type": "string", + "description": "A URL that displays a product's permissions and that can also be used to approve the product with the Products.approve call." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#approvalUrlInfo\".", + "default": "androidenterprise#approvalUrlInfo" + } + } + }, "Collection": { "id": "Collection", "type": "object", @@ -256,6 +288,10 @@ "type": "string", "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#device\".", "default": "androidenterprise#device" + }, + "managementType": { + "type": "string", + "description": "The mechanism by which this device is managed by the MDM. \"managedDevice\" means that the MDM's app is a device owner. \"managedProfile\" means that the MDM's app is the profile owner (and there is a separate personal profile which is not managed). \"containerApp\" means that the MDM's app is managing the Android for Work container app on the device." } } }, @@ -542,6 +578,13 @@ "type": "object", "description": "A product represents an app in the Google Play Store that is available to at least some users in the enterprise. (Some apps are restricted to a single enterprise, and no information about them is made available outside that enterprise.)\n\nThe information provided for each product (localized name, icon, link to the full Google Play details page) is intended to allow a basic representation of the product within an MDM user interface.", "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.", + "items": { + "$ref": "AppVersion" + } + }, "authorName": { "type": "string", "description": "The name of the author of the product (e.g. the app developer)." @@ -550,6 +593,10 @@ "type": "string", "description": "A link to the (consumer) Google Play details page for the product." }, + "distributionChannel": { + "type": "string", + "description": "How and to whom the package is made available." + }, "iconUrl": { "type": "string", "description": "A link to an image that can be used as an icon for the product." @@ -563,6 +610,10 @@ "type": "string", "description": "A string of the form \"app:\n\" - e.g. \"app:com.google.android.gm\" represents the GMail app." }, + "requiresContainerApp": { + "type": "boolean", + "description": "Whether this app can only be installed on devices using the Android for Work container app." + }, "title": { "type": "string", "description": "The name of the product." @@ -616,6 +667,25 @@ } } }, + "ProductsApproveRequest": { + "id": "ProductsApproveRequest", + "type": "object", + "properties": { + "approvalUrlInfo": { + "$ref": "ApprovalUrlInfo" + } + } + }, + "ProductsGenerateApprovalUrlResponse": { + "id": "ProductsGenerateApprovalUrlResponse", + "type": "object", + "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." + } + } + }, "User": { "id": "User", "type": "object", @@ -1894,6 +1964,71 @@ }, "products": { "methods": { + "approve": { + "id": "androidenterprise.products.approve", + "path": "enterprises/{enterpriseId}/products/{productId}/approve", + "httpMethod": "POST", + "description": "Approves the specified product (and the relevant app permissions, if any).", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "productId": { + "type": "string", + "description": "The ID of the product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "productId" + ], + "request": { + "$ref": "ProductsApproveRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "generateApprovalUrl": { + "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.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "languageCode": { + "type": "string", + "description": "The language code that will be used for permission names and descriptions in the returned iframe.", + "location": "query" + }, + "productId": { + "type": "string", + "description": "The ID of the product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "productId" + ], + "response": { + "$ref": "ProductsGenerateApprovalUrlResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, "get": { "id": "androidenterprise.products.get", "path": "enterprises/{enterpriseId}/products/{productId}", diff --git a/etc/api/androidpublisher/v1.1/androidpublisher-api.json b/etc/api/androidpublisher/v1.1/androidpublisher-api.json index 372070ccf3..98b6fd7065 100644 --- a/etc/api/androidpublisher/v1.1/androidpublisher-api.json +++ b/etc/api/androidpublisher/v1.1/androidpublisher-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/yLZNoMooQ7qHvZwtvucNfre7PCU\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ZaYQrw3QnZiD1YIdYaHXGlnz-Sc\"", "discoveryVersion": "v1", "id": "androidpublisher:v1.1", "name": "androidpublisher", "canonicalName": "Android Publisher", "version": "v1.1", - "revision": "20150323", + "revision": "20150316", "title": "Google Play Developer API", "description": "Lets Android application developers access their Google Play accounts.", "ownerDomain": "google.com", diff --git a/etc/api/androidpublisher/v1/androidpublisher-api.json b/etc/api/androidpublisher/v1/androidpublisher-api.json index d0d65ec89e..3563b80c12 100644 --- a/etc/api/androidpublisher/v1/androidpublisher-api.json +++ b/etc/api/androidpublisher/v1/androidpublisher-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/JGynskXPDYAm7HfLDYPma5VcVjE\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/dWS1TT1km61X8qMyP5gPBt6y1MQ\"", "discoveryVersion": "v1", "id": "androidpublisher:v1", "name": "androidpublisher", "canonicalName": "Android Publisher", "version": "v1", - "revision": "20150323", + "revision": "20150316", "title": "Google Play Developer API", "description": "Lets Android application developers access their Google Play accounts.", "ownerDomain": "google.com", diff --git a/etc/api/androidpublisher/v2/androidpublisher-api.json b/etc/api/androidpublisher/v2/androidpublisher-api.json index a51a77022a..74692315b1 100644 --- a/etc/api/androidpublisher/v2/androidpublisher-api.json +++ b/etc/api/androidpublisher/v2/androidpublisher-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/2DGQXV9vEvRmzTOqKw6AgrR-Dxw\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/gtEzcfWnBY9EC00QyZ_jjrGf9Io\"", "discoveryVersion": "v1", "id": "androidpublisher:v2", "name": "androidpublisher", "canonicalName": "Android Publisher", "version": "v2", - "revision": "20150323", + "revision": "20150316", "title": "Google Play Developer API", "description": "Lets Android application developers access their Google Play accounts.", "ownerDomain": "google.com", @@ -208,6 +208,48 @@ } } }, + "Entitlement": { + "id": "Entitlement", + "type": "object", + "description": "An Entitlement resource indicates a user's current entitlement to an inapp item or subscription.", + "properties": { + "kind": { + "type": "string", + "description": "This kind represents an entitlement object in the androidpublisher service.", + "default": "androidpublisher#entitlement" + }, + "productId": { + "type": "string", + "description": "The SKU of the product." + }, + "productType": { + "type": "string", + "description": "The type of the inapp product. Possible values are: \n- In-app item: \"inapp\" \n- Subscription: \"subs\"" + }, + "token": { + "type": "string", + "description": "The token which can be verified using the subscriptions or products API." + } + } + }, + "EntitlementsListResponse": { + "id": "EntitlementsListResponse", + "type": "object", + "properties": { + "pageInfo": { + "$ref": "PageInfo" + }, + "resources": { + "type": "array", + "items": { + "$ref": "Entitlement" + } + }, + "tokenPagination": { + "$ref": "TokenPagination" + } + } + }, "ExpansionFile": { "id": "ExpansionFile", "type": "object", @@ -2528,6 +2570,49 @@ } } }, + "entitlements": { + "methods": { + "list": { + "id": "androidpublisher.entitlements.list", + "path": "{packageName}/entitlements", + "httpMethod": "GET", + "description": "Lists the user's current inapp item or subscription entitlements", + "parameters": { + "maxResults": { + "type": "integer", + "format": "uint32", + "location": "query" + }, + "packageName": { + "type": "string", + "description": "The package name of the application the inapp product was sold in (for example, 'com.some.thing').", + "required": true, + "location": "path" + }, + "productId": { + "type": "string", + "description": "The product id of the inapp product (for example, 'sku1'). This can be used to restrict the result set.", + "location": "query" + }, + "startIndex": { + "type": "integer", + "format": "uint32", + "location": "query" + }, + "token": { + "type": "string", + "location": "query" + } + }, + "parameterOrder": [ + "packageName" + ], + "response": { + "$ref": "EntitlementsListResponse" + } + } + } + }, "inappproducts": { "methods": { "batch": { diff --git a/etc/api/api-list.yaml b/etc/api/api-list.yaml index 2086221af5..ac13b2e52e 100644 --- a/etc/api/api-list.yaml +++ b/etc/api/api-list.yaml @@ -43,6 +43,8 @@ api: - v2 cloudmonitoring: - v2beta2 + cloudresourcemanager: + - v1beta1 cloudsearch: - v1 compute: @@ -60,7 +62,7 @@ api: datastore: - v1beta2 deploymentmanager: - - v2beta1 + - v2beta2 dfareporting: - v2.1 discovery: @@ -88,8 +90,6 @@ api: - v1management gan: - v1beta1 - genomics: - - v1beta2 gmail: - v1 groupsmigration: diff --git a/etc/api/appsactivity/v1/appsactivity-api.json b/etc/api/appsactivity/v1/appsactivity-api.json index a3d9f88413..b36756be64 100644 --- a/etc/api/appsactivity/v1/appsactivity-api.json +++ b/etc/api/appsactivity/v1/appsactivity-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ctDJuvwARuvWdxppTAPJ3B-E-pc\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ZeC-oWzDKj1E5_H69LVDW5wAByE\"", "discoveryVersion": "v1", "id": "appsactivity:v1", "name": "appsactivity", "version": "v1", - "revision": "20140828", + "revision": "20150326", "title": "Google Apps Activity API", "description": "Provides a historical view of activity.", "ownerDomain": "google.com", @@ -75,6 +75,9 @@ "https://www.googleapis.com/auth/drive": { "description": "View and manage the files in your Google Drive" }, + "https://www.googleapis.com/auth/drive.metadata": { + "description": "View and manage metadata of files in your Google Drive" + }, "https://www.googleapis.com/auth/drive.metadata.readonly": { "description": "View metadata for files in your Google Drive" }, @@ -463,6 +466,7 @@ "scopes": [ "https://www.googleapis.com/auth/activity", "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.metadata", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly" ] diff --git a/etc/api/appstate/v1/appstate-api.json b/etc/api/appstate/v1/appstate-api.json index f8b11a17c1..65f8fd252f 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/_qtMBNYmtGLL9lEXbS-_U7qtvOE\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ak8oEX6cObVqcgf5lnMSd2yQgWQ\"", "discoveryVersion": "v1", "id": "appstate:v1", "name": "appstate", "canonicalName": "App State", "version": "v1", - "revision": "20150414", + "revision": "20150527", "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 119c96a926..cc7ef03548 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/nHGuU-ZWpZ4KpLWJiQ2L2nYZjNQ\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/cly7KQK-fjW4wH1MBNTB5Dx6wSc\"", "discoveryVersion": "v1", "id": "autoscaler:v1beta2", "name": "autoscaler", "version": "v1beta2", - "revision": "20141112", + "revision": "20150617", "title": "Google Compute Engine Autoscaler API", "description": "The Google Compute Engine Autoscaler API provides autoscaling for groups of Cloud VMs.", "ownerDomain": "google.com", @@ -298,7 +298,7 @@ }, "kind": { "type": "string", - "description": "[Output Only] Type of the resource. Always kind#operation for Operation resources.", + "description": "[Output Only] Type of the resource. Always compute#Operation for Operation resources.", "default": "autoscaler#operation" }, "name": { @@ -384,7 +384,7 @@ }, "kind": { "type": "string", - "description": "Type of resource. Always compute#operations for Operations resource.", + "description": "[Output Only] Type of resource. Always compute#operations for Operations resource.", "default": "autoscaler#operationList" }, "nextPageToken": { @@ -414,7 +414,7 @@ }, "kind": { "type": "string", - "description": "Type of the resource.", + "description": "[Output Only] Type of the resource. Always kind#zone for zones.", "default": "autoscaler#zone" }, "maintenanceWindows": { @@ -445,7 +445,7 @@ }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server defined URL for the resource." }, "status": { "type": "string" diff --git a/etc/api/bigquery/v2/bigquery-api.json b/etc/api/bigquery/v2/bigquery-api.json index 0414ecef4d..98ab1e2b4f 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/R2tvUOg0npxomcc8XogN9tN818k\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/dfyqUMrFd-mvh1ZHmWj5OJLDhTI\"", "discoveryVersion": "v1", "id": "bigquery:v2", "name": "bigquery", "version": "v2", - "revision": "20150326", + "revision": "20150526", "title": "BigQuery API", "description": "A data platform for customers to create, manage, share and query data.", "ownerDomain": "google.com", @@ -115,7 +115,9 @@ }, "quote": { "type": "string", - "description": "[Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('\"'). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines property to true." + "description": "[Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('\"'). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines property to true.", + "default": "\"", + "pattern": ".?" }, "skipLeadingRows": { "type": "integer", @@ -201,6 +203,10 @@ "description": "[Output-only] The date when this dataset or any of its tables was last modified, in milliseconds since the epoch.", "format": "int64" }, + "location": { + "type": "string", + "description": "[Experimental] The location where the data resides. If not present, the data will be stored in the US." + }, "selfLink": { "type": "string", "description": "[Output-only] A URL that can be used to access the resource again. You can use this URL in Get or Update requests to the resource." @@ -431,6 +437,21 @@ } } }, + "JobCancelResponse": { + "id": "JobCancelResponse", + "type": "object", + "properties": { + "job": { + "$ref": "Job", + "description": "The final state of the job." + }, + "kind": { + "type": "string", + "description": "The resource type of the response.", + "default": "bigquery#jobCancelResponse" + } + } + }, "JobConfiguration": { "id": "JobConfiguration", "type": "object", @@ -490,7 +511,8 @@ }, "printHeader": { "type": "boolean", - "description": "[Optional] Whether to print out a header row in the results. Default is true." + "description": "[Optional] Whether to print out a header row in the results. Default is true.", + "default": "true" }, "sourceTable": { "$ref": "TableReference", @@ -569,7 +591,9 @@ }, "quote": { "type": "string", - "description": "[Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('\"'). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines property to true." + "description": "[Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('\"'). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines property to true.", + "default": "\"", + "pattern": ".?" }, "schema": { "$ref": "TableSchema", @@ -601,7 +625,7 @@ }, "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." + "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_APPEND. 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." } } }, @@ -627,7 +651,8 @@ }, "flattenResults": { "type": "boolean", - "description": "[Optional] Flattens all nested and repeated fields in the query results. The default value is true. allowLargeResults must be true if this is set to false." + "description": "[Optional] Flattens all nested and repeated fields in the query results. The default value is true. allowLargeResults must be true if this is set to false.", + "default": "true" }, "preserveNulls": { "type": "boolean", @@ -650,7 +675,8 @@ }, "useQueryCache": { "type": "boolean", - "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." + "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" }, "writeDisposition": { "type": "string", @@ -749,11 +775,6 @@ "nextPageToken": { "type": "string", "description": "A token to request the next page of results." - }, - "totalItems": { - "type": "integer", - "description": "Total number of jobs in this collection.", - "format": "int32" } } }, @@ -1014,7 +1035,8 @@ }, "useQueryCache": { "type": "boolean", - "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. The default value is true." + "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. The default value is true.", + "default": "true" } } }, @@ -1141,7 +1163,6 @@ "TableCell": { "id": "TableCell", "type": "object", - "description": "Represents a single cell in the result set. Users of the java client can detect whether their value result is null by calling 'com.google.api.client.util.Data.isNull(cell.getV())'.", "properties": { "v": { "type": "any" @@ -1366,10 +1387,10 @@ "TableRow": { "id": "TableRow", "type": "object", - "description": "Represents a single row in the result set, consisting of one or more fields.", "properties": { "f": { "type": "array", + "description": "Represents a single row in the result set, consisting of one or more fields.", "items": { "$ref": "TableCell" } @@ -1606,6 +1627,37 @@ }, "jobs": { "methods": { + "cancel": { + "id": "bigquery.jobs.cancel", + "path": "project/{projectId}/jobs/{jobId}/cancel", + "httpMethod": "POST", + "description": "Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully.", + "parameters": { + "jobId": { + "type": "string", + "description": "Job ID of the job to cancel", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID of the job to cancel", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "response": { + "$ref": "JobCancelResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "get": { "id": "bigquery.jobs.get", "path": "projects/{projectId}/jobs/{jobId}", diff --git a/etc/api/books/v1/books-api.json b/etc/api/books/v1/books-api.json index f8038a0c90..00eb463981 100644 --- a/etc/api/books/v1/books-api.json +++ b/etc/api/books/v1/books-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/RU3_yBWk7Dll2fVe-S46ywC_3gs\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/5UMRPQM2lE_tfb1BMv9TTmTYYF8\"", "discoveryVersion": "v1", "id": "books:v1", "name": "books", "version": "v1", - "revision": "20150401", + "revision": "20150318", "title": "Books API", "description": "Lets you search for books and manage your Google Books library.", "ownerDomain": "google.com", @@ -1619,6 +1619,10 @@ "type": "object", "description": "General volume information.", "properties": { + "allowAnonLogging": { + "type": "boolean", + "description": "Whether anonymous logging should be allowed." + }, "authors": { "type": "array", "description": "The names of the authors and/or editors for this volume. (In LITE projection)", @@ -3413,6 +3417,19 @@ "description": "ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset.", "location": "query" }, + "maxAllowedMaturityRating": { + "type": "string", + "description": "The maximum allowed maturity rating of returned volumes. Books with a higher maturity rating are filtered out.", + "enum": [ + "mature", + "not-mature" + ], + "enumDescriptions": [ + "Show books which are rated mature or lower.", + "Show books which are rated not mature." + ], + "location": "query" + }, "pageSize": { "type": "integer", "description": "Number of maximum results per page to be included in the response.", @@ -3807,6 +3824,19 @@ "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.", "location": "query" }, + "maxAllowedMaturityRating": { + "type": "string", + "description": "The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out.", + "enum": [ + "mature", + "not-mature" + ], + "enumDescriptions": [ + "Show books which are rated mature or lower.", + "Show books which are rated not mature." + ], + "location": "query" + }, "source": { "type": "string", "description": "String to identify the originator of this request.", @@ -3927,6 +3957,19 @@ "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.", "location": "query" }, + "maxAllowedMaturityRating": { + "type": "string", + "description": "The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out.", + "enum": [ + "mature", + "not-mature" + ], + "enumDescriptions": [ + "Show books which are rated mature or lower.", + "Show books which are rated not mature." + ], + "location": "query" + }, "source": { "type": "string", "description": "String to identify the originator of this request.", diff --git a/etc/api/calendar/v3/calendar-api.json b/etc/api/calendar/v3/calendar-api.json index 5826513ccf..88edffa988 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/snCOExYvhrzEZTGzdubZtafuHVU\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/uB0KPjQ-_FKwri9S67F19ijFpA4\"", "discoveryVersion": "v1", "id": "calendar:v3", "name": "calendar", "version": "v3", - "revision": "20150326", + "revision": "20150408", "title": "Calendar API", "description": "Lets you manipulate events and other calendar data.", "ownerDomain": "google.com", @@ -1479,7 +1479,7 @@ }, "minAccessRole": { "type": "string", - "description": "The minimum access role for the user in the returned entires. Optional. The default is no restriction.", + "description": "The minimum access role for the user in the returned entries. Optional. The default is no restriction.", "enum": [ "freeBusyReader", "owner", @@ -1601,7 +1601,7 @@ }, "minAccessRole": { "type": "string", - "description": "The minimum access role for the user in the returned entires. Optional. The default is no restriction.", + "description": "The minimum access role for the user in the returned entries. Optional. The default is no restriction.", "enum": [ "freeBusyReader", "owner", diff --git a/etc/api/cloudlatencytest/v2/cloudlatencytest-api.json b/etc/api/cloudlatencytest/v2/cloudlatencytest-api.json index 3f0f1a08b0..59d3fc9a71 100644 --- a/etc/api/cloudlatencytest/v2/cloudlatencytest-api.json +++ b/etc/api/cloudlatencytest/v2/cloudlatencytest-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/qJOZypus2JZqrrIOB0BaiZ76VFY\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/-PbBjCBr5ChXewUXbKSMo5aP4BY\"", "discoveryVersion": "v1", "id": "cloudlatencytest:v2", "name": "cloudlatencytest", "version": "v2", - "revision": "20150206", + "revision": "20150508", "title": "Google Cloud Network Performance Monitoring API", "description": "A Test API to report latency data.", "ownerDomain": "google.com", diff --git a/etc/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json b/etc/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json index 5bf5388b85..a7f458901e 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/8AX4EEpwBs_EPri68uJBfOfq5Bo\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/-ljPm2yVKKaBbJo9gwx1YPyHZqo\"", "discoveryVersion": "v1", "id": "cloudmonitoring:v2beta2", "name": "cloudmonitoring", "canonicalName": "Cloud Monitoring", "version": "v2beta2", - "revision": "20150401", + "revision": "20150616", "title": "Cloud Monitoring API", "description": "API for accessing Google Cloud and API monitoring data.", "ownerDomain": "google.com", diff --git a/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json b/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json new file mode 100644 index 0000000000..7b3d29959b --- /dev/null +++ b/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json @@ -0,0 +1,324 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Kw6n-qAgUnPZR8Gtqry3vxhHFsg\"", + "discoveryVersion": "v1", + "id": "cloudresourcemanager:v1beta1", + "name": "cloudresourcemanager", + "version": "v1beta1", + "revision": "20150603", + "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.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/resource-manager", + "protocol": "rest", + "baseUrl": "https://cloudresourcemanager.googleapis.com/", + "basePath": "", + "rootUrl": "https://cloudresourcemanager.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "schemas": { + "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.", + "properties": { + "projectNumber": { + "type": "string", + "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." + }, + "lifecycleState": { + "type": "string", + "description": "The project lifecycle state. Read-only.", + "enum": [ + "LIFECYCLE_STATE_UNSPECIFIED", + "ACTIVE", + "DELETE_REQUESTED", + "DELETE_IN_PROGRESS" + ] + }, + "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." + }, + "createTime": { + "type": "string", + "description": "Creation time. Read-only." + }, + "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.", + "additionalProperties": { + "type": "string" + } + } + } + }, + "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.", + "properties": { + "projects": { + "type": "array", + "description": "The list of projects that matched the list filter. This list can be paginated.", + "items": { + "$ref": "Project" + } + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token. If the result set is too large to fit in a single response, this token is returned. It encodes the position of the current result cursor. Feeding this value into a new list request with the `page_token` parameter gives the next page of the results. When `next_page_token` is not filled in, there is no next page and the list returned is the last page in the result set. Pagination tokens have a limited lifetime. Note: pagination is not yet supported; the server will not set this field." + } + } + }, + "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); }" + } + }, + "resources": { + "projects": { + "methods": { + "create": { + "id": "cloudresourcemanager.projects.create", + "path": "v1beta1/projects", + "httpMethod": "POST", + "description": "Creates a project resource. Initially, the project resource is owned by its creator exclusively. The creator can later grant permission to others to read or update the project. Several APIs are activated automatically for the project, including Google Cloud Storage.", + "request": { + "$ref": "Project" + }, + "response": { + "$ref": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "id": "cloudresourcemanager.projects.list", + "path": "v1beta1/projects", + "httpMethod": "GET", + "description": "Lists projects that are visible to the user and satisfy the specified filter. This method returns projects in an unspecified order. New projects do not necessarily appear at the end of the list.", + "parameters": { + "pageToken": { + "type": "string", + "description": "A pagination token returned from a previous call to ListProject that indicates from where listing should continue. Note: pagination is not yet supported; the server ignores this field. Optional.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of Projects to return in the response. The server can return fewer projects than requested. If unspecified, server picks an appropriate default. Note: pagination is not yet supported; the server ignores this field. Optional.", + "format": "int32", + "location": "query" + }, + "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.", + "location": "query" + } + }, + "response": { + "$ref": "ListProjectsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "cloudresourcemanager.projects.get", + "path": "v1beta1/projects/{projectId}", + "httpMethod": "GET", + "description": "Retrieves the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this project.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project ID (for example, `my-project-123`). Required.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "update": { + "id": "cloudresourcemanager.projects.update", + "path": "v1beta1/projects/{projectId}", + "httpMethod": "PUT", + "description": "Updates the attributes of the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have modify permissions for this project.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project ID (for example, `my-project-123`). Required.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "request": { + "$ref": "Project" + }, + "response": { + "$ref": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "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.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project ID (for example, `foo-bar-123`). Required.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "undelete": { + "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.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project ID (for example, `foo-bar-123`). Required.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } +} diff --git a/etc/api/clouduseraccounts/alpha/clouduseraccounts-api.json b/etc/api/clouduseraccounts/alpha/clouduseraccounts-api.json new file mode 100644 index 0000000000..2093381488 --- /dev/null +++ b/etc/api/clouduseraccounts/alpha/clouduseraccounts-api.json @@ -0,0 +1,1363 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/_7ZaOXPJ-jAUoW6H7-tPOuF-gko\"", + "discoveryVersion": "v1", + "id": "clouduseraccounts:alpha", + "name": "clouduseraccounts", + "canonicalName": "Cloud User Accounts", + "version": "alpha", + "revision": "20150619", + "title": "Cloud User Accounts API", + "description": "API for the Google Cloud User Accounts service.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://cloud.google.com/compute/docs/access/user-accounts/api/latest/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/clouduseraccounts/alpha/projects/", + "basePath": "/clouduseraccounts/alpha/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "clouduseraccounts/alpha/projects/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/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" + }, + "https://www.googleapis.com/auth/computeaccounts.readonly": { + "description": "View your Google Compute Accounts" + } + } + } + }, + "schemas": { + "AuthorizedKeysView": { + "id": "AuthorizedKeysView", + "type": "object", + "description": "A list of authorized public keys for a user account.", + "properties": { + "keys": { + "type": "array", + "description": "[Output Only] The list of authorized public keys in SSH format.", + "items": { + "type": "string" + } + } + } + }, + "Group": { + "id": "Group", + "type": "object", + "description": "A Group resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "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." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#group for groups.", + "default": "clouduseraccounts#group" + }, + "members": { + "type": "array", + "description": "[Output Only] A list of URLs to User resources who belong to the group. Users may only be members of groups in the same project.", + "items": { + "type": "string" + } + }, + "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": [ + "clouduseraccounts.groups.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "GroupList": { + "id": "GroupList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Group resources.", + "items": { + "$ref": "Group" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always clouduseraccounts#groupList for lists of groups.", + "default": "clouduseraccounts#groupList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "GroupsAddMemberRequest": { + "id": "GroupsAddMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to add.", + "items": { + "type": "string" + } + } + } + }, + "GroupsRemoveMemberRequest": { + "id": "GroupsRemoveMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to remove.", + "items": { + "type": "string" + } + } + } + }, + "LinuxAccountViews": { + "id": "LinuxAccountViews", + "type": "object", + "description": "A list of all Linux accounts for this project. This API is only used by Compute Engine virtual machines to get information about user accounts for a project or instance. Linux resources are read-only views into users and groups managed by the Compute Engine Accounts API.", + "properties": { + "groupViews": { + "type": "array", + "description": "[Output Only] A list of all groups within a project.", + "items": { + "$ref": "LinuxGroupView" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#linuxAccountViews for Linux resources.", + "default": "clouduseraccounts#linuxAccountViews" + }, + "userViews": { + "type": "array", + "description": "[Output Only] A list of all users within a project.", + "items": { + "$ref": "LinuxUserView" + } + } + } + }, + "LinuxGetAuthorizedKeysViewResponse": { + "id": "LinuxGetAuthorizedKeysViewResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "AuthorizedKeysView", + "description": "[Output Only] A list of authorized public keys for a user." + } + } + }, + "LinuxGetLinuxAccountViewsResponse": { + "id": "LinuxGetLinuxAccountViewsResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "LinuxAccountViews", + "description": "[Output Only] A list of authorized user accounts and groups." + } + } + }, + "LinuxGroupView": { + "id": "LinuxGroupView", + "type": "object", + "description": "A detailed view of a Linux group.", + "properties": { + "gid": { + "type": "integer", + "description": "[Output Only] The Group ID.", + "format": "uint32" + }, + "groupName": { + "type": "string", + "description": "[Output Only] Group name." + }, + "members": { + "type": "array", + "description": "[Output Only] List of user accounts that belong to the group.", + "items": { + "type": "string" + } + } + } + }, + "LinuxUserView": { + "id": "LinuxUserView", + "type": "object", + "description": "A detailed view of a Linux user account.", + "properties": { + "gecos": { + "type": "string", + "description": "[Output Only] The GECOS (user information) entry for this account." + }, + "gid": { + "type": "integer", + "description": "[Output Only] User's default group ID.", + "format": "uint32" + }, + "homeDirectory": { + "type": "string", + "description": "[Output Only] The path to the home directory for this account." + }, + "shell": { + "type": "string", + "description": "[Output Only] The path to the login shell for this account." + }, + "uid": { + "type": "integer", + "description": "[Output Only] User ID.", + "format": "uint32" + }, + "username": { + "type": "string", + "description": "[Output Only] The username of the account." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "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." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This is in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors are generated during processing of the operation, this field will be populated.", + "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." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This is in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#Operation for Operation resources.", + "default": "clouduseraccounts#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output Only] Type of the operation, such as insert, update, and delete." + }, + "progress": { + "type": "integer", + "description": "[Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only applicable for regional resources." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server. This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.", + "enum": [ + "DONE", + "PENDING", + "RUNNING" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of the operation, this field will be populated.", + "items": { + "type": "object", + "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." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of Operation resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] The Operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operations for Operations resource.", + "default": "clouduseraccounts#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncate." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "PublicKey": { + "id": "PublicKey", + "type": "object", + "description": "A public key for authenticating to guests.", + "properties": { + "creationTimestamp": { + "type": "string", + "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." + }, + "expirationTimestamp": { + "type": "string", + "description": "Optional expiration timestamp. If provided, the timestamp must be in RFC3339 text format. If not provided, the public key never expires." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the key is defined by RFC4716 to be the MD5 digest of the public key." + }, + "key": { + "type": "string", + "description": "Public key text in SSH format, defined by RFC4253 section 6.6." + } + } + }, + "User": { + "id": "User", + "type": "object", + "description": "A User resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "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." + }, + "groups": { + "type": "array", + "description": "[Output Only] A list of URLs to Group resources who contain the user. Users are only members of groups in the same project.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#user for users.", + "default": "clouduseraccounts#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": [ + "clouduseraccounts.users.insert" + ] + } + }, + "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": [ + "clouduseraccounts.users.insert" + ] + } + }, + "publicKeys": { + "type": "array", + "description": "[Output Only] Public keys that this user may use to login.", + "items": { + "$ref": "PublicKey" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "UserList": { + "id": "UserList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of User resources.", + "items": { + "$ref": "User" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always clouduseraccounts#userList for lists of users.", + "default": "clouduseraccounts#userList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + } + }, + "resources": { + "globalAccountsOperations": { + "methods": { + "delete": { + "id": "clouduseraccounts.globalAccountsOperations.delete", + "path": "{project}/global/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "operation" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "get": { + "id": "clouduseraccounts.globalAccountsOperations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "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" + ] + }, + "list": { + "id": "clouduseraccounts.globalAccountsOperations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified project.", + "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", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "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": "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": "OperationList" + }, + "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" + ] + } + } + }, + "groups": { + "methods": { + "addMember": { + "id": "clouduseraccounts.groups.addMember", + "path": "{project}/global/groups/{groupName}/addMember", + "httpMethod": "POST", + "description": "Adds users to the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "groupName" + ], + "request": { + "$ref": "GroupsAddMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "delete": { + "id": "clouduseraccounts.groups.delete", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "DELETE", + "description": "Deletes the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "groupName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "get": { + "id": "clouduseraccounts.groups.get", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "GET", + "description": "Returns the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "groupName" + ], + "response": { + "$ref": "Group" + }, + "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" + ] + }, + "insert": { + "id": "clouduseraccounts.groups.insert", + "path": "{project}/global/groups", + "httpMethod": "POST", + "description": "Creates a Group resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "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" + ], + "request": { + "$ref": "Group" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "list": { + "id": "clouduseraccounts.groups.list", + "path": "{project}/global/groups", + "httpMethod": "GET", + "description": "Retrieves the list of groups contained within the specified project.", + "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", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "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": "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": "GroupList" + }, + "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" + ] + }, + "removeMember": { + "id": "clouduseraccounts.groups.removeMember", + "path": "{project}/global/groups/{groupName}/removeMember", + "httpMethod": "POST", + "description": "Removes users from the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "groupName" + ], + "request": { + "$ref": "GroupsRemoveMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + } + } + }, + "linux": { + "methods": { + "getAuthorizedKeysView": { + "id": "clouduseraccounts.linux.getAuthorizedKeysView", + "path": "{project}/zones/{zone}/authorizedKeysView/{user}", + "httpMethod": "POST", + "description": "Returns a list of authorized public keys for a specific user account.", + "parameters": { + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the view.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "The user account for which you want to get a list of authorized public keys.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "user", + "instance" + ], + "response": { + "$ref": "LinuxGetAuthorizedKeysViewResponse" + }, + "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" + ] + }, + "getLinuxAccountViews": { + "id": "clouduseraccounts.linux.getLinuxAccountViews", + "path": "{project}/zones/{zone}/linuxAccountViews", + "httpMethod": "POST", + "description": "Retrieves a list of user accounts for an instance within a specific project.", + "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" + }, + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the views.", + "required": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "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": "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" + }, + "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.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "LinuxGetLinuxAccountViewsResponse" + }, + "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" + ] + } + } + }, + "users": { + "methods": { + "addPublicKey": { + "id": "clouduseraccounts.users.addPublicKey", + "path": "{project}/global/users/{user}/addPublicKey", + "httpMethod": "POST", + "description": "Adds a public key to the specified User resource with the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "request": { + "$ref": "PublicKey" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "delete": { + "id": "clouduseraccounts.users.delete", + "path": "{project}/global/users/{user}", + "httpMethod": "DELETE", + "description": "Deletes the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "Name of the user resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "get": { + "id": "clouduseraccounts.users.get", + "path": "{project}/global/users/{user}", + "httpMethod": "GET", + "description": "Returns the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "Name of the user resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "User" + }, + "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" + ] + }, + "insert": { + "id": "clouduseraccounts.users.insert", + "path": "{project}/global/users", + "httpMethod": "POST", + "description": "Creates a User resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "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" + ], + "request": { + "$ref": "User" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "list": { + "id": "clouduseraccounts.users.list", + "path": "{project}/global/users", + "httpMethod": "GET", + "description": "Retrieves a list of users contained within the specified project.", + "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", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "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": "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": "UserList" + }, + "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" + ] + }, + "removePublicKey": { + "id": "clouduseraccounts.users.removePublicKey", + "path": "{project}/global/users/{user}/removePublicKey", + "httpMethod": "POST", + "description": "Removes the specified public key from the user.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the public key.", + "required": true, + "pattern": "[a-f0-9]{32}", + "location": "query" + }, + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user", + "fingerprint" + ], + "response": { + "$ref": "Operation" + }, + "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/clouduseraccounts/vm_alpha/clouduseraccounts-api.json b/etc/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json new file mode 100644 index 0000000000..467c0b469a --- /dev/null +++ b/etc/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json @@ -0,0 +1,1363 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/k0bgAHzJI3AFP0ewt4BJ1NCB-jU\"", + "discoveryVersion": "v1", + "id": "clouduseraccounts:vm_alpha", + "name": "clouduseraccounts", + "canonicalName": "Cloud User Accounts", + "version": "vm_alpha", + "revision": "20150619", + "title": "Cloud User Accounts API", + "description": "API for the Google Cloud User Accounts service.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://cloud.google.com/compute/docs/access/user-accounts/api/latest/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/clouduseraccounts/vm_alpha/projects/", + "basePath": "/clouduseraccounts/vm_alpha/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "clouduseraccounts/vm_alpha/projects/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/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" + }, + "https://www.googleapis.com/auth/computeaccounts.readonly": { + "description": "View your Google Compute Accounts" + } + } + } + }, + "schemas": { + "AuthorizedKeysView": { + "id": "AuthorizedKeysView", + "type": "object", + "description": "A list of authorized public keys for a user account.", + "properties": { + "keys": { + "type": "array", + "description": "[Output Only] The list of authorized public keys in SSH format.", + "items": { + "type": "string" + } + } + } + }, + "Group": { + "id": "Group", + "type": "object", + "description": "A Group resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "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." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#group for groups.", + "default": "clouduseraccounts#group" + }, + "members": { + "type": "array", + "description": "[Output Only] A list of URLs to User resources who belong to the group. Users may only be members of groups in the same project.", + "items": { + "type": "string" + } + }, + "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": [ + "clouduseraccounts.groups.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "GroupList": { + "id": "GroupList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Group resources.", + "items": { + "$ref": "Group" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always clouduseraccounts#groupList for lists of groups.", + "default": "clouduseraccounts#groupList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "GroupsAddMemberRequest": { + "id": "GroupsAddMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to add.", + "items": { + "type": "string" + } + } + } + }, + "GroupsRemoveMemberRequest": { + "id": "GroupsRemoveMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to remove.", + "items": { + "type": "string" + } + } + } + }, + "LinuxAccountViews": { + "id": "LinuxAccountViews", + "type": "object", + "description": "A list of all Linux accounts for this project. This API is only used by Compute Engine virtual machines to get information about user accounts for a project or instance. Linux resources are read-only views into users and groups managed by the Compute Engine Accounts API.", + "properties": { + "groupViews": { + "type": "array", + "description": "[Output Only] A list of all groups within a project.", + "items": { + "$ref": "LinuxGroupView" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#linuxAccountViews for Linux resources.", + "default": "clouduseraccounts#linuxAccountViews" + }, + "userViews": { + "type": "array", + "description": "[Output Only] A list of all users within a project.", + "items": { + "$ref": "LinuxUserView" + } + } + } + }, + "LinuxGetAuthorizedKeysViewResponse": { + "id": "LinuxGetAuthorizedKeysViewResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "AuthorizedKeysView", + "description": "[Output Only] A list of authorized public keys for a user." + } + } + }, + "LinuxGetLinuxAccountViewsResponse": { + "id": "LinuxGetLinuxAccountViewsResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "LinuxAccountViews", + "description": "[Output Only] A list of authorized user accounts and groups." + } + } + }, + "LinuxGroupView": { + "id": "LinuxGroupView", + "type": "object", + "description": "A detailed view of a Linux group.", + "properties": { + "gid": { + "type": "integer", + "description": "[Output Only] The Group ID.", + "format": "uint32" + }, + "groupName": { + "type": "string", + "description": "[Output Only] Group name." + }, + "members": { + "type": "array", + "description": "[Output Only] List of user accounts that belong to the group.", + "items": { + "type": "string" + } + } + } + }, + "LinuxUserView": { + "id": "LinuxUserView", + "type": "object", + "description": "A detailed view of a Linux user account.", + "properties": { + "gecos": { + "type": "string", + "description": "[Output Only] The GECOS (user information) entry for this account." + }, + "gid": { + "type": "integer", + "description": "[Output Only] User's default group ID.", + "format": "uint32" + }, + "homeDirectory": { + "type": "string", + "description": "[Output Only] The path to the home directory for this account." + }, + "shell": { + "type": "string", + "description": "[Output Only] The path to the login shell for this account." + }, + "uid": { + "type": "integer", + "description": "[Output Only] User ID.", + "format": "uint32" + }, + "username": { + "type": "string", + "description": "[Output Only] The username of the account." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "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." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This is in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors are generated during processing of the operation, this field will be populated.", + "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." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This is in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#Operation for Operation resources.", + "default": "clouduseraccounts#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output Only] Type of the operation, such as insert, update, and delete." + }, + "progress": { + "type": "integer", + "description": "[Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only applicable for regional resources." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server. This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.", + "enum": [ + "DONE", + "PENDING", + "RUNNING" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of the operation, this field will be populated.", + "items": { + "type": "object", + "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." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of Operation resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] The Operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operations for Operations resource.", + "default": "clouduseraccounts#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncate." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "PublicKey": { + "id": "PublicKey", + "type": "object", + "description": "A public key for authenticating to guests.", + "properties": { + "creationTimestamp": { + "type": "string", + "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." + }, + "expirationTimestamp": { + "type": "string", + "description": "Optional expiration timestamp. If provided, the timestamp must be in RFC3339 text format. If not provided, the public key never expires." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the key is defined by RFC4716 to be the MD5 digest of the public key." + }, + "key": { + "type": "string", + "description": "Public key text in SSH format, defined by RFC4253 section 6.6." + } + } + }, + "User": { + "id": "User", + "type": "object", + "description": "A User resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "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." + }, + "groups": { + "type": "array", + "description": "[Output Only] A list of URLs to Group resources who contain the user. Users are only members of groups in the same project.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#user for users.", + "default": "clouduseraccounts#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": [ + "clouduseraccounts.users.insert" + ] + } + }, + "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": [ + "clouduseraccounts.users.insert" + ] + } + }, + "publicKeys": { + "type": "array", + "description": "[Output Only] Public keys that this user may use to login.", + "items": { + "$ref": "PublicKey" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "UserList": { + "id": "UserList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of User resources.", + "items": { + "$ref": "User" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always clouduseraccounts#userList for lists of users.", + "default": "clouduseraccounts#userList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + } + }, + "resources": { + "globalAccountsOperations": { + "methods": { + "delete": { + "id": "clouduseraccounts.globalAccountsOperations.delete", + "path": "{project}/global/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "operation" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "get": { + "id": "clouduseraccounts.globalAccountsOperations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "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" + ] + }, + "list": { + "id": "clouduseraccounts.globalAccountsOperations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified project.", + "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", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "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": "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": "OperationList" + }, + "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" + ] + } + } + }, + "groups": { + "methods": { + "addMember": { + "id": "clouduseraccounts.groups.addMember", + "path": "{project}/global/groups/{groupName}/addMember", + "httpMethod": "POST", + "description": "Adds users to the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "groupName" + ], + "request": { + "$ref": "GroupsAddMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "delete": { + "id": "clouduseraccounts.groups.delete", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "DELETE", + "description": "Deletes the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "groupName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "get": { + "id": "clouduseraccounts.groups.get", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "GET", + "description": "Returns the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "groupName" + ], + "response": { + "$ref": "Group" + }, + "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" + ] + }, + "insert": { + "id": "clouduseraccounts.groups.insert", + "path": "{project}/global/groups", + "httpMethod": "POST", + "description": "Creates a Group resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "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" + ], + "request": { + "$ref": "Group" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "list": { + "id": "clouduseraccounts.groups.list", + "path": "{project}/global/groups", + "httpMethod": "GET", + "description": "Retrieves the list of groups contained within the specified project.", + "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", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "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": "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": "GroupList" + }, + "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" + ] + }, + "removeMember": { + "id": "clouduseraccounts.groups.removeMember", + "path": "{project}/global/groups/{groupName}/removeMember", + "httpMethod": "POST", + "description": "Removes users from the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "groupName" + ], + "request": { + "$ref": "GroupsRemoveMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + } + } + }, + "linux": { + "methods": { + "getAuthorizedKeysView": { + "id": "clouduseraccounts.linux.getAuthorizedKeysView", + "path": "{project}/zones/{zone}/authorizedKeysView/{user}", + "httpMethod": "POST", + "description": "Returns a list of authorized public keys for a specific user account.", + "parameters": { + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the view.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "The user account for which you want to get a list of authorized public keys.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "user", + "instance" + ], + "response": { + "$ref": "LinuxGetAuthorizedKeysViewResponse" + }, + "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" + ] + }, + "getLinuxAccountViews": { + "id": "clouduseraccounts.linux.getLinuxAccountViews", + "path": "{project}/zones/{zone}/linuxAccountViews", + "httpMethod": "POST", + "description": "Retrieves a list of user accounts for an instance within a specific project.", + "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" + }, + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the views.", + "required": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "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": "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" + }, + "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.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "LinuxGetLinuxAccountViewsResponse" + }, + "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" + ] + } + } + }, + "users": { + "methods": { + "addPublicKey": { + "id": "clouduseraccounts.users.addPublicKey", + "path": "{project}/global/users/{user}/addPublicKey", + "httpMethod": "POST", + "description": "Adds a public key to the specified User resource with the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "request": { + "$ref": "PublicKey" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "delete": { + "id": "clouduseraccounts.users.delete", + "path": "{project}/global/users/{user}", + "httpMethod": "DELETE", + "description": "Deletes the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "Name of the user resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "get": { + "id": "clouduseraccounts.users.get", + "path": "{project}/global/users/{user}", + "httpMethod": "GET", + "description": "Returns the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "Name of the user resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "User" + }, + "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" + ] + }, + "insert": { + "id": "clouduseraccounts.users.insert", + "path": "{project}/global/users", + "httpMethod": "POST", + "description": "Creates a User resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "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" + ], + "request": { + "$ref": "User" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "list": { + "id": "clouduseraccounts.users.list", + "path": "{project}/global/users", + "httpMethod": "GET", + "description": "Retrieves a list of users contained within the specified project.", + "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", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "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": "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": "UserList" + }, + "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" + ] + }, + "removePublicKey": { + "id": "clouduseraccounts.users.removePublicKey", + "path": "{project}/global/users/{user}/removePublicKey", + "httpMethod": "POST", + "description": "Removes the specified public key from the user.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the public key.", + "required": true, + "pattern": "[a-f0-9]{32}", + "location": "query" + }, + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user", + "fingerprint" + ], + "response": { + "$ref": "Operation" + }, + "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/compute/v1/compute-api.json b/etc/api/compute/v1/compute-api.json index 85eb6174d4..d161d80430 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/SRyMqDO5Lt1H_OK2ek0Fc_aeb5M\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/KR3ZwQmcUACaSsWyMOhFw8te6OA\"", "discoveryVersion": "v1", "id": "compute:v1", "name": "compute", "version": "v1", - "revision": "20150326", + "revision": "20150305", "title": "Compute Engine API", "description": "API for the Google Compute Engine service.", "ownerDomain": "google.com", @@ -277,6 +277,7 @@ "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", @@ -296,6 +297,7 @@ "", "", "", + "", "" ] }, @@ -451,7 +453,7 @@ }, "capacityScaler": { "type": "number", - "description": "The multiplier (a value between 0 and 1e6) 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, 1e6].", + "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].", "format": "float" }, "description": { @@ -482,7 +484,7 @@ "BackendService": { "id": "BackendService", "type": "object", - "description": "A BackendService resource. This resource defines a group of backend VMs together with their serving capacity.", + "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", "properties": { "backends": { "type": "array", @@ -663,6 +665,14 @@ "description": "[Output Only] Type of the resource. Always compute#disk for disks.", "default": "compute#disk" }, + "lastAttachTimestamp": { + "type": "string", + "description": "[Output Only] Last attach timestamp in RFC3339 text format." + }, + "lastDetachTimestamp": { + "type": "string", + "description": "[Output Only] Last detach timestamp in RFC3339 text format." + }, "licenses": { "type": "array", "description": "Any applicable publicly visible licenses.", @@ -729,6 +739,13 @@ "type": "string", "description": "URL of the disk type resource describing which disk type to use to create the disk; provided by the client when the disk is created." }, + "users": { + "type": "array", + "description": "Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance", + "items": { + "type": "string" + } + }, "zone": { "type": "string", "description": "[Output Only] URL of the zone where the disk resides." @@ -951,6 +968,7 @@ "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", @@ -970,6 +988,7 @@ "", "", "", + "", "" ] }, @@ -1025,6 +1044,7 @@ "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", @@ -1044,6 +1064,7 @@ "", "", "", + "", "" ] }, @@ -1345,6 +1366,7 @@ "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", @@ -1364,6 +1386,7 @@ "", "", "", + "", "" ] }, @@ -1784,13 +1807,15 @@ }, "status": { "type": "string", - "description": "[Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, TERMINATED.", + "description": "[Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, and TERMINATED.", "enum": [ "PROVISIONING", "RUNNING", "STAGING", "STOPPED", "STOPPING", + "SUSPENDED", + "SUSPENDING", "TERMINATED" ], "enumDescriptions": [ @@ -1799,6 +1824,8 @@ "", "", "", + "", + "", "" ] }, @@ -1899,22 +1926,22 @@ "properties": { "canIpForward": { "type": "boolean", - "description": "Allows instances created based on this template to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, say true. If unsure, leave this set to false." + "description": "A boolean that specifies if instances created from this template can send packets with source IP addresses other than their own or receive packets with destination IP addresses other than their own. If you use these instances as an IP gateway or as the next-hop in a Route resource, specify true. Otherwise, specify false." }, "description": { "type": "string", - "description": "An optional textual description for the instances created based on the instance template resource; provided by the client when the template is created." + "description": "An optional text description for the instances that are created from this instance template." }, "disks": { "type": "array", - "description": "Array of disks associated with instance created based on this template.", + "description": "An array of disks that are associated with the instances that are created from this template.", "items": { "$ref": "AttachedDisk" } }, "machineType": { "type": "string", - "description": "Name of the machine type resource describing which machine type to use to host the instances created based on this template; provided by the client when the instance template is created.", + "description": "The machine type to use for instances that are created from this template.", "annotations": { "required": [ "compute.instanceTemplates.insert" @@ -1923,29 +1950,29 @@ }, "metadata": { "$ref": "Metadata", - "description": "Metadata key/value pairs assigned to instances created based on this template. Consists of custom metadata or predefined keys; see Instance documentation for more information." + "description": "The metadata key/value pairs to assign to instances that are created from this template. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information." }, "networkInterfaces": { "type": "array", - "description": "Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instances created based based on this template will have no external internet access.", + "description": "An array of network access configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only supported access configuration. If you do not specify any access configurations, the instances that are created from this template will have no external internet access.", "items": { "$ref": "NetworkInterface" } }, "scheduling": { "$ref": "Scheduling", - "description": "Scheduling options for the instances created based on this template." + "description": "A list of scheduling options for the instances that are created from this template." }, "serviceAccounts": { "type": "array", - "description": "A list of service accounts each with specified scopes, for which access tokens are to be made available to the instances created based on this template, through metadata queries.", + "description": "A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this template. Use metadata queries to obtain the access tokens for these instances.", "items": { "$ref": "ServiceAccount" } }, "tags": { "$ref": "Tags", - "description": "A list of tags to be applied to the instances created based on this template used to identify valid sources or targets for network firewalls. Provided by the client on instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035." + "description": "A list of tags to apply to the instances that are created from this template. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035." } } }, @@ -1965,25 +1992,25 @@ "properties": { "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] The creation timestamp for this instance template in RFC3339 text format." }, "description": { "type": "string", - "description": "An optional textual description of the instance template resource; provided by the client when the resource is created." + "description": "An optional text description for the instance template." }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] A unique identifier for this instance template. The server defines this identifier.", "format": "uint64" }, "kind": { "type": "string", - "description": "Type of the resource.", + "description": "[Output Only] The resource type, which is always compute#instanceTemplate for instance templates.", "default": "compute#instanceTemplate" }, "name": { "type": "string", - "description": "Name of the instance template resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035", + "description": "The name of the instance template. 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": [ @@ -1993,22 +2020,22 @@ }, "properties": { "$ref": "InstanceProperties", - "description": "The instance properties portion of this instance template resource." + "description": "The instance properties for the instance template resource." }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] The URL for this instance template. The server defines this URL." } } }, "InstanceTemplateList": { "id": "InstanceTemplateList", "type": "object", - "description": "Contains a list of instance template resources.", + "description": "A list of instance templates.", "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] A unique identifier for this instance template. The server defines this identifier." }, "items": { "type": "array", @@ -2019,16 +2046,16 @@ }, "kind": { "type": "string", - "description": "Type of resource.", + "description": "[Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists.", "default": "compute#instanceTemplateList" }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token that is used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] The URL for this instance template list. The server defines this URL." } } }, @@ -2059,6 +2086,7 @@ "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", @@ -2078,6 +2106,7 @@ "", "", "", + "", "" ] }, @@ -2306,6 +2335,7 @@ "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", @@ -2325,6 +2355,7 @@ "", "", "", + "", "" ] }, @@ -2523,7 +2554,7 @@ "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", @@ -2593,7 +2624,7 @@ }, "progress": { "type": "integer", - "description": "[Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should be monotonically increasing as the operation progresses.", + "description": "[Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should monotonically increase as the operation progresses.", "format": "int32" }, "region": { @@ -2657,6 +2688,7 @@ "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", @@ -2676,6 +2708,7 @@ "", "", "", + "", "" ] }, @@ -2798,6 +2831,7 @@ "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", @@ -2817,6 +2851,7 @@ "", "", "", + "", "" ] }, @@ -2958,6 +2993,7 @@ "HEALTH_CHECKS", "IMAGES", "INSTANCES", + "INSTANCE_TEMPLATES", "IN_USE_ADDRESSES", "LOCAL_SSD_TOTAL_GB", "NETWORKS", @@ -2993,6 +3029,7 @@ "", "", "", + "", "" ] }, @@ -3180,7 +3217,7 @@ }, "priority": { "type": "integer", - "description": "Breaks ties between Routes of equal specificity. Routes with smaller values win when tied with routes with larger values.", + "description": "Breaks ties between Routes of equal specificity. Routes with smaller values win when tied with routes with larger values. Default value is 1000. A valid range is between 0 and 65535.", "format": "uint32", "annotations": { "required": [ @@ -3222,6 +3259,7 @@ "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", @@ -3241,6 +3279,7 @@ "", "", "", + "", "" ] }, @@ -3321,6 +3360,10 @@ "", "" ] + }, + "preemptible": { + "type": "boolean", + "description": "Whether the Instance is preemptible." } } }, @@ -3711,6 +3754,7 @@ "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", @@ -3730,6 +3774,7 @@ "", "", "", + "", "" ] }, @@ -3991,6 +4036,7 @@ "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", @@ -4010,6 +4056,7 @@ "", "", "", + "", "" ] }, @@ -4217,6 +4264,7 @@ "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", @@ -4236,6 +4284,7 @@ "", "", "", + "", "" ] }, @@ -4549,6 +4598,7 @@ "FIRST_HANDSHAKE", "NEGOTIATION_FAILURE", "NETWORK_ERROR", + "NO_INCOMING_PACKETS", "PROVISIONING", "WAITING_FOR_FULL_CONFIG" ], @@ -4561,6 +4611,7 @@ "", "", "", + "", "" ] }, @@ -4664,6 +4715,7 @@ "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", @@ -4683,6 +4735,7 @@ "", "", "", + "", "" ] }, @@ -4832,12 +4885,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -4846,7 +4899,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -4996,12 +5049,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -5010,7 +5063,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -5184,12 +5237,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -5198,7 +5251,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -5305,12 +5358,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -5319,7 +5372,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -5392,12 +5445,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -5406,7 +5459,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -5449,12 +5502,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -5463,7 +5516,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -5662,12 +5715,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -5676,7 +5729,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -5814,12 +5867,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -5828,7 +5881,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -5935,12 +5988,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -5949,7 +6002,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -6099,12 +6152,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -6113,7 +6166,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -6295,12 +6348,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -6309,7 +6362,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -6439,12 +6492,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -6453,7 +6506,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -6524,12 +6577,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -6538,7 +6591,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -6633,12 +6686,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -6647,7 +6700,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -6777,12 +6830,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -6791,7 +6844,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -7032,12 +7085,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -7046,7 +7099,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -7077,18 +7130,18 @@ "id": "compute.instanceTemplates.delete", "path": "{project}/global/instanceTemplates/{instanceTemplate}", "httpMethod": "DELETE", - "description": "Deletes the specified instance template resource.", + "description": "Deletes the specified instance template.", "parameters": { "instanceTemplate": { "type": "string", - "description": "Name of the instance template resource to delete.", + "description": "The name of the instance template 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.", + "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" @@ -7114,14 +7167,14 @@ "parameters": { "instanceTemplate": { "type": "string", - "description": "Name of the instance template resource to return.", + "description": "The name of the instance template.", "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.", + "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" @@ -7144,11 +7197,11 @@ "id": "compute.instanceTemplates.insert", "path": "{project}/global/instanceTemplates", "httpMethod": "POST", - "description": "Creates an instance template resource in the specified project using the data included in the request.", + "description": "Creates an instance template in the specified project using the data that is included in the request.", "parameters": { "project": { "type": "string", - "description": "Name of the project scoping this request.", + "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" @@ -7172,16 +7225,16 @@ "id": "compute.instanceTemplates.list", "path": "{project}/global/instanceTemplates", "httpMethod": "GET", - "description": "Retrieves the list of instance template resources contained within the specified project.", + "description": "Retrieves a list of instance templates that are contained within the specified project and zone.", "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -7190,12 +7243,12 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { "type": "string", - "description": "Name of the project scoping this request.", + "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" @@ -7275,12 +7328,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -7289,7 +7342,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -7638,12 +7691,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -7652,7 +7705,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -7961,7 +8014,7 @@ "parameters": { "instance": { "type": "string", - "description": "Name of the instance resource to start.", + "description": "Name of the instance resource to stop.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -8044,12 +8097,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -8058,7 +8111,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -8131,12 +8184,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -8145,7 +8198,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -8283,12 +8336,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -8297,7 +8350,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -8557,12 +8610,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -8571,7 +8624,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -8648,12 +8701,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -8662,7 +8715,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -8792,12 +8845,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -8806,7 +8859,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -8908,12 +8961,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -8922,7 +8975,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -9052,12 +9105,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -9066,7 +9119,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -9137,12 +9190,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -9151,7 +9204,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -9301,12 +9354,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -9315,7 +9368,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -9444,12 +9497,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -9458,7 +9511,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -9652,12 +9705,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -9666,7 +9719,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -9845,12 +9898,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -9859,7 +9912,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -10009,12 +10062,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -10023,7 +10076,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -10161,12 +10214,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -10175,7 +10228,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -10318,12 +10371,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -10332,7 +10385,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -10482,12 +10535,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -10496,7 +10549,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -10619,12 +10672,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -10633,7 +10686,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", "location": "query" }, "project": { @@ -10710,12 +10763,12 @@ "parameters": { "filter": { "type": "string", - "description": "Optional. Filter expression for filtering listed resources.", + "description": "Filter expression for filtering listed resources.", "location": "query" }, "maxResults": { "type": "integer", - "description": "Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.", + "description": "Maximum count of results to be returned.", "default": "500", "format": "uint32", "minimum": "0", @@ -10724,7 +10777,7 @@ }, "pageToken": { "type": "string", - "description": "Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.", + "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue 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 new file mode 100644 index 0000000000..ce05d14f64 --- /dev/null +++ b/etc/api/computeaccounts/alpha/computeaccounts-api.json @@ -0,0 +1,1337 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/_MU5PPcJ1QQhdPzgwNErr00pIY8\"", + "discoveryVersion": "v1", + "id": "computeaccounts:alpha", + "name": "computeaccounts", + "canonicalName": "Compute Accounts", + "version": "alpha", + "revision": "20150320", + "title": "Compute Accounts API", + "description": "API for the Google Compute Accounts service.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://cloud.google.com/compute/docs/access/user-accounts/api/latest/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/computeaccounts/alpha/projects/", + "basePath": "/computeaccounts/alpha/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "computeaccounts/alpha/projects/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/computeaccounts": { + "description": "Manage your Google Compute Accounts" + }, + "https://www.googleapis.com/auth/computeaccounts.readonly": { + "description": "View your Google Compute Accounts" + } + } + } + }, + "schemas": { + "AuthorizedKeysView": { + "id": "AuthorizedKeysView", + "type": "object", + "description": "A list of authorized public keys for a user account.", + "properties": { + "keys": { + "type": "array", + "description": "[Output Only] The list of authorized public keys in SSH format.", + "items": { + "type": "string" + } + } + } + }, + "Group": { + "id": "Group", + "type": "object", + "description": "A Group resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "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." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always computeaccounts#group for groups.", + "default": "computeaccounts#group" + }, + "members": { + "type": "array", + "description": "[Output Only] A list of URLs to User resources who belong to the group. Users may only be members of groups in the same project.", + "items": { + "type": "string" + } + }, + "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" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "GroupList": { + "id": "GroupList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Group resources.", + "items": { + "$ref": "Group" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always computeaccounts#groupList for lists of groups.", + "default": "computeaccounts#groupList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "GroupsAddMemberRequest": { + "id": "GroupsAddMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to add.", + "items": { + "type": "string" + } + } + } + }, + "GroupsRemoveMemberRequest": { + "id": "GroupsRemoveMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to remove.", + "items": { + "type": "string" + } + } + } + }, + "LinuxAccountViews": { + "id": "LinuxAccountViews", + "type": "object", + "description": "A list of all Linux accounts for this project. This API is only used by Compute Engine virtual machines to get information about user accounts for a project or instance. Linux resources are read-only views into users and groups managed by the Compute Engine Accounts API.", + "properties": { + "groupViews": { + "type": "array", + "description": "[Output Only] A list of all groups within a project.", + "items": { + "$ref": "LinuxGroupView" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always computeaccounts#linuxAccountViews for Linux resources.", + "default": "computeaccounts#linuxAccountViews" + }, + "userViews": { + "type": "array", + "description": "[Output Only] A list of all users within a project.", + "items": { + "$ref": "LinuxUserView" + } + } + } + }, + "LinuxGetAuthorizedKeysViewResponse": { + "id": "LinuxGetAuthorizedKeysViewResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "AuthorizedKeysView", + "description": "[Output Only] A list of authorized public keys for a user." + } + } + }, + "LinuxGetLinuxAccountViewsResponse": { + "id": "LinuxGetLinuxAccountViewsResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "LinuxAccountViews", + "description": "[Output Only] A list of authorized user accounts and groups." + } + } + }, + "LinuxGroupView": { + "id": "LinuxGroupView", + "type": "object", + "description": "A detailed view of a Linux group.", + "properties": { + "gid": { + "type": "integer", + "description": "[Output Only] The Group ID.", + "format": "uint32" + }, + "groupName": { + "type": "string", + "description": "[Output Only] Group name." + }, + "members": { + "type": "array", + "description": "[Output Only] List of user accounts that belong to the group.", + "items": { + "type": "string" + } + } + } + }, + "LinuxUserView": { + "id": "LinuxUserView", + "type": "object", + "description": "A detailed view of a Linux user account.", + "properties": { + "gecos": { + "type": "string", + "description": "[Output Only] The GECOS (user information) entry for this account." + }, + "gid": { + "type": "integer", + "description": "[Output Only] User's default group ID.", + "format": "uint32" + }, + "homeDirectory": { + "type": "string", + "description": "[Output Only] The path to the home directory for this account." + }, + "shell": { + "type": "string", + "description": "[Output Only] The path to the login shell for this account." + }, + "uid": { + "type": "integer", + "description": "[Output Only] User ID.", + "format": "uint32" + }, + "username": { + "type": "string", + "description": "[Output Only] The username of the account." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "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." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This is in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors are generated during processing of the operation, this field will be populated.", + "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." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This is in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#Operation for Operation resources.", + "default": "computeaccounts#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output Only] Type of the operation, such as insert, update, and delete." + }, + "progress": { + "type": "integer", + "description": "[Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only applicable for regional resources." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server. This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.", + "enum": [ + "DONE", + "PENDING", + "RUNNING" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of the operation, this field will be populated.", + "items": { + "type": "object", + "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." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of operation resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] The operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operations for Operations resource.", + "default": "computeaccounts#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncate." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "PublicKey": { + "id": "PublicKey", + "type": "object", + "description": "A public key for authenticating to guests.", + "properties": { + "creationTimestamp": { + "type": "string", + "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." + }, + "expirationTimestamp": { + "type": "string", + "description": "Optional expiration timestamp. If provided, the timestamp must be in RFC3339 text format. If not provided, the public key never expires." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the key is defined by RFC4716 to be the MD5 digest of the public key." + }, + "key": { + "type": "string", + "description": "Public key text in SSH format, defined by RFC4253 section 6.6." + } + } + }, + "User": { + "id": "User", + "type": "object", + "description": "A User resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "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." + }, + "groups": { + "type": "array", + "description": "[Output Only] A list of URLs to Group resources who contain the user. Users are only members of groups in the same project.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always computeaccounts#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" + ] + } + }, + "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" + ] + } + }, + "publicKeys": { + "type": "array", + "description": "[Output Only] Public keys that this user may use to login.", + "items": { + "$ref": "PublicKey" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "UserList": { + "id": "UserList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of User resources.", + "items": { + "$ref": "User" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always computeaccounts#userList for lists of users.", + "default": "computeaccounts#userList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + } + }, + "resources": { + "globalAccountsOperations": { + "methods": { + "delete": { + "id": "computeaccounts.globalAccountsOperations.delete", + "path": "{project}/global/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "operation" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "get": { + "id": "computeaccounts.globalAccountsOperations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the operation resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts", + "https://www.googleapis.com/auth/computeaccounts.readonly" + ] + }, + "list": { + "id": "computeaccounts.globalAccountsOperations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "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.", + "location": "query" + }, + "project": { + "type": "string", + "description": "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": "OperationList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts", + "https://www.googleapis.com/auth/computeaccounts.readonly" + ] + } + } + }, + "groups": { + "methods": { + "addMember": { + "id": "computeaccounts.groups.addMember", + "path": "{project}/global/groups/{groupName}/addMember", + "httpMethod": "POST", + "description": "Adds users to the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "groupName" + ], + "request": { + "$ref": "GroupsAddMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "delete": { + "id": "computeaccounts.groups.delete", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "DELETE", + "description": "Deletes the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "groupName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "get": { + "id": "computeaccounts.groups.get", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "GET", + "description": "Returns the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "groupName" + ], + "response": { + "$ref": "Group" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts", + "https://www.googleapis.com/auth/computeaccounts.readonly" + ] + }, + "insert": { + "id": "computeaccounts.groups.insert", + "path": "{project}/global/groups", + "httpMethod": "POST", + "description": "Creates a Group resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "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" + ], + "request": { + "$ref": "Group" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "list": { + "id": "computeaccounts.groups.list", + "path": "{project}/global/groups", + "httpMethod": "GET", + "description": "Retrieves the list of groups contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "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.", + "location": "query" + }, + "project": { + "type": "string", + "description": "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": "GroupList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts", + "https://www.googleapis.com/auth/computeaccounts.readonly" + ] + }, + "removeMember": { + "id": "computeaccounts.groups.removeMember", + "path": "{project}/global/groups/{groupName}/removeMember", + "httpMethod": "POST", + "description": "Removes users from the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "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", + "groupName" + ], + "request": { + "$ref": "GroupsRemoveMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts" + ] + } + } + }, + "linux": { + "methods": { + "getAuthorizedKeysView": { + "id": "computeaccounts.linux.getAuthorizedKeysView", + "path": "{project}/zones/{zone}/authorizedKeysView/{user}", + "httpMethod": "POST", + "description": "Returns a list of authorized public keys for a specific user account.", + "parameters": { + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the view.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "The user account for which you want to get a list of authorized public keys.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "user", + "instance" + ], + "response": { + "$ref": "LinuxGetAuthorizedKeysViewResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts", + "https://www.googleapis.com/auth/computeaccounts.readonly" + ] + }, + "getLinuxAccountViews": { + "id": "computeaccounts.linux.getLinuxAccountViews", + "path": "{project}/zones/{zone}/linuxAccountViews", + "httpMethod": "POST", + "description": "Retrieves a list of user accounts for an instance within a specific project.", + "parameters": { + "filter": { + "type": "string", + "description": "Filter expression for filtering listed resources.", + "location": "query" + }, + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the views.", + "required": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "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.", + "location": "query" + }, + "project": { + "type": "string", + "description": "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" + }, + "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.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "LinuxGetLinuxAccountViewsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts", + "https://www.googleapis.com/auth/computeaccounts.readonly" + ] + } + } + }, + "users": { + "methods": { + "addPublicKey": { + "id": "computeaccounts.users.addPublicKey", + "path": "{project}/global/users/{user}/addPublicKey", + "httpMethod": "POST", + "description": "Adds a public key to the specified User resource with the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "request": { + "$ref": "PublicKey" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "delete": { + "id": "computeaccounts.users.delete", + "path": "{project}/global/users/{user}", + "httpMethod": "DELETE", + "description": "Deletes the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "Name of the user resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "get": { + "id": "computeaccounts.users.get", + "path": "{project}/global/users/{user}", + "httpMethod": "GET", + "description": "Returns the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "Name of the user resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts", + "https://www.googleapis.com/auth/computeaccounts.readonly" + ] + }, + "insert": { + "id": "computeaccounts.users.insert", + "path": "{project}/global/users", + "httpMethod": "POST", + "description": "Creates a User resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "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" + ], + "request": { + "$ref": "User" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts" + ] + }, + "list": { + "id": "computeaccounts.users.list", + "path": "{project}/global/users", + "httpMethod": "GET", + "description": "Retrieves a list of users contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Filter expression for filtering listed resources.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "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.", + "location": "query" + }, + "project": { + "type": "string", + "description": "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": "UserList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/computeaccounts", + "https://www.googleapis.com/auth/computeaccounts.readonly" + ] + }, + "removePublicKey": { + "id": "computeaccounts.users.removePublicKey", + "path": "{project}/global/users/{user}/removePublicKey", + "httpMethod": "POST", + "description": "Removes the specified public key from the user.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the public key.", + "required": true, + "pattern": "[a-f0-9]{32}", + "location": "query" + }, + "project": { + "type": "string", + "description": "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" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user", + "fingerprint" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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 e1ded0e36c..0b7a20be3b 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/dYpTeptRRQe2JpT9NpqLcHD0A_0\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/OAfpRt1IaExVFs9TE2m103dNYns\"", "discoveryVersion": "v1", "id": "container:v1beta1", "name": "container", "version": "v1beta1", - "revision": "20150420", + "revision": "20150617", "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", @@ -86,7 +86,7 @@ }, "containerIpv4Cidr": { "type": "string", - "description": "The IP addresses of the container pods in this cluster, in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one automatically chosen or specify a /14 block in 10.0.0.0/8 or 172.16.0.0/12." + "description": "The IP address range of the container pods in this cluster, in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one automatically chosen or specify a /14 block in 10.0.0.0/8 or 172.16.0.0/12." }, "creationTimestamp": { "type": "string", @@ -100,10 +100,21 @@ "type": "boolean", "description": "Whether logs from the cluster should be made available via the Google Cloud Logging service. This includes both logs from your applications running in the cluster as well as logs from the Kubernetes components themselves." }, + "enableCloudMonitoring": { + "type": "boolean", + "description": "Whether metrics from the cluster should be made available via the Google Cloud Monitoring service." + }, "endpoint": { "type": "string", "description": "[Output only] The IP address of this cluster's Kubernetes master. The endpoint can be accessed from the internet at https://username:password@endpoint/.\n\nSee the masterAuth property of this resource for username and password information." }, + "instanceGroupUrls": { + "type": "array", + "description": "[Output only] The resource URLs of [instance groups](/compute/docs/instance-groups/) associated with this cluster.", + "items": { + "type": "string" + } + }, "masterAuth": { "$ref": "MasterAuth", "description": "The authentication information for accessing the master." @@ -136,7 +147,7 @@ }, "servicesIpv4Cidr": { "type": "string", - "description": "[Output only] The IP addresses of the Kubernetes services in this cluster, in CIDR notation (e.g. 1.2.3.4/29). Service addresses are always in the 10.0.0.0/16 range." + "description": "[Output only] The IP address range of the Kubernetes services in this cluster, in CIDR notation (e.g. 1.2.3.4/29). Service addresses are typically put in the last /16 from the container CIDR." }, "status": { "type": "string", @@ -233,7 +244,19 @@ "properties": { "bearerToken": { "type": "string", - "description": "The token used to authenticate API requests to the master. The token is be included in an HTTP Authorization Header included in all requests to the master endpoint. The format of the header is: \"Authorization: Bearer \"." + "description": "The token used to authenticate API requests to the master. The token is to be included in an HTTP Authorization Header in all requests to the master endpoint. The format of the header is: \"Authorization: Bearer \"." + }, + "clientCertificate": { + "type": "string", + "description": "[Output only] Base64 encoded public certificate used by clients to authenticate to the cluster endpoint." + }, + "clientKey": { + "type": "string", + "description": "[Output only] Base64 encoded private key used by clients to authenticate to the cluster endpoint." + }, + "clusterCaCertificate": { + "type": "string", + "description": "[Output only] Base64 encoded public certificate that is the root of trust for the cluster." }, "password": { "type": "string", @@ -277,7 +300,7 @@ }, "name": { "type": "string", - "description": "The server-assigned ID for this operation. If the operation is fulfilled upfront, it may not have a resource name." + "description": "The server-assigned ID for the operation." }, "operationType": { "type": "string", @@ -340,21 +363,6 @@ } } } - }, - "Token": { - "id": "Token", - "type": "object", - "properties": { - "accessToken": { - "type": "string", - "description": "The OAuth2 access token" - }, - "expiryTimeSeconds": { - "type": "string", - "description": "The expiration time of the token in seconds since the unix epoch.", - "format": "int64" - } - } } }, "resources": { @@ -422,7 +430,7 @@ "id": "container.projects.zones.clusters.create", "path": "{projectId}/zones/{zoneId}/clusters", "httpMethod": "POST", - "description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances, plus a Kubernetes master instance.\n\nThe cluster is created in the project's default network.\n\nA firewall is added that allows traffic into port 443 on the master, which enables HTTPS. A firewall and a route is added for each node to allow the containers on that node to communicate with all other instances in the cluster.\n\nFinally, a route named k8s-iproute-10-xx-0-0 is created to track that the cluster's 10.xx.0.0/16 CIDR has been assigned.", + "description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances, plus a Kubernetes master instance.\n\nThe cluster is created in the project's default network.\n\nA firewall is added that allows traffic into port 443 on the master, which enables HTTPS. A firewall and a route is added for each node to allow the containers on that node to communicate with all other instances in the cluster.\n\nFinally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster.", "parameters": { "projectId": { "type": "string", @@ -627,52 +635,6 @@ ] } } - }, - "tokens": { - "methods": { - "get": { - "id": "container.projects.zones.tokens.get", - "path": "{masterProjectId}/zones/{zoneId}/tokens/{projectNumber}/{clusterName}", - "httpMethod": "GET", - "description": "Gets a compute-rw scoped OAuth2 access token for\n. Authentication is performed to ensure that the caller is a member of and that the request is coming from the expected master VM for the specified cluster. See go/gke-cross-project-auth for more details.", - "parameters": { - "clusterName": { - "type": "string", - "description": "The name of the specified cluster.", - "required": true, - "location": "path" - }, - "masterProjectId": { - "type": "string", - "description": "The hosted master project from which this request is coming.", - "required": true, - "location": "path" - }, - "projectNumber": { - "type": "string", - "description": "The project number for which the access token is being requested.", - "required": true, - "format": "int64", - "location": "path" - }, - "zoneId": { - "type": "string", - "description": "The zone of the specified cluster.", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "masterProjectId", - "zoneId", - "projectNumber", - "clusterName" - ], - "response": { - "$ref": "Token" - } - } - } } } } diff --git a/etc/api/content/v2/content-api.json b/etc/api/content/v2/content-api.json index 60e732c6a8..7d5144256a 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/sWwx6biSrC_gtsZDUBqZWGBMUuA\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/RsxRME9Gu_f17mSFUnwX4Br4j90\"", "discoveryVersion": "v1", "id": "content:v2", "name": "content", "canonicalName": "Shopping Content", "version": "v2", - "revision": "20150421", + "revision": "20150528", "title": "Content API for Shopping", "description": "Manage product items, inventory, and Merchant Center accounts for Google Shopping.", "ownerDomain": "google.com", diff --git a/etc/api/dataflow/v1b3/dataflow-api.json b/etc/api/dataflow/v1b3/dataflow-api.json index 007964b891..02a2d03dea 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/M59Icz2EWO9QQuzKsN_i4A0cHXE\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/0aH3PsMrpC4Dqa5K4gjLDjAQxF8\"", "discoveryVersion": "v1", "id": "dataflow:v1b3", "name": "dataflow", "version": "v1b3", - "revision": "20150322", + "revision": "20150303", "title": "Google Dataflow API", "description": "Google Dataflow API.", "ownerDomain": "google.com", @@ -306,6 +306,9 @@ "id": "Job", "type": "object", "properties": { + "clientRequestId": { + "type": "string" + }, "createTime": { "type": "string" }, @@ -346,6 +349,9 @@ "projectId": { "type": "string" }, + "replaceJobId": { + "type": "string" + }, "requestedState": { "type": "string", "enum": [ @@ -371,6 +377,12 @@ "$ref": "Step" } }, + "transformNameMapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "type": { "type": "string", "enum": [ @@ -420,6 +432,7 @@ "messageImportance": { "type": "string", "enum": [ + "JOB_MESSAGE_BASIC", "JOB_MESSAGE_DEBUG", "JOB_MESSAGE_DETAILED", "JOB_MESSAGE_ERROR", @@ -431,6 +444,7 @@ "", "", "", + "", "" ] }, @@ -1501,6 +1515,9 @@ "diskSourceImage": { "type": "string" }, + "diskType": { + "type": "string" + }, "kind": { "type": "string" }, @@ -1513,6 +1530,9 @@ "type": "string" } }, + "network": { + "type": "string" + }, "numWorkers": { "type": "integer", "format": "int32" @@ -1608,6 +1628,10 @@ "required": true, "location": "path" }, + "replaceJobId": { + "type": "string", + "location": "query" + }, "view": { "type": "string", "enum": [ @@ -1845,6 +1869,7 @@ "minimumImportance": { "type": "string", "enum": [ + "JOB_MESSAGE_BASIC", "JOB_MESSAGE_DEBUG", "JOB_MESSAGE_DETAILED", "JOB_MESSAGE_ERROR", @@ -1856,6 +1881,7 @@ "", "", "", + "", "" ], "location": "query" diff --git a/etc/api/deploymentmanager/v2beta1/deploymentmanager-api.json b/etc/api/deploymentmanager/v2beta1/deploymentmanager-api.json index 13af32817b..dfb2303bc2 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/hE1oPYTxWhviFb0v73gueyAW5mA\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/zdpw3TZ9gd3rzuoO0gRqQ93MGhU\"", "discoveryVersion": "v1", "id": "deploymentmanager:v2beta1", "name": "deploymentmanager", "version": "v2beta1", - "revision": "20150415", + "revision": "20150616", "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 new file mode 100644 index 0000000000..6f0e11a3d0 --- /dev/null +++ b/etc/api/deploymentmanager/v2beta2/deploymentmanager-api.json @@ -0,0 +1,1200 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/vTct0YRTxHgCzwTq1Z7USX--R9M\"", + "discoveryVersion": "v1", + "id": "deploymentmanager:v2beta2", + "name": "deploymentmanager", + "canonicalName": "Deployment Manager", + "version": "v2beta2", + "revision": "20150616", + "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", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/deployment-manager/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/deploymentmanager/v2beta2/projects/", + "basePath": "/deploymentmanager/v2beta2/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "deploymentmanager/v2beta2/projects/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/ndev.cloudman": { + "description": "View and manage your Google Cloud Platform management resources and deployment status information" + }, + "https://www.googleapis.com/auth/ndev.cloudman.readonly": { + "description": "View your Google Cloud Platform management resources and deployment status information" + } + } + } + }, + "schemas": { + "Deployment": { + "id": "Deployment", + "type": "object", + "description": "", + "properties": { + "description": { + "type": "string", + "description": "An optional user-provided description of the deployment." + }, + "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.", + "format": "byte" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] Timestamp when the deployment was created, in RFC3339 text format ." + }, + "intent": { + "type": "string", + "description": "[Input Only] Specifies how Deployment Manager should apply this template. Possible options are PREVIEW, UPDATE, and CANCEL.\n\nPREVIEW creates a deployment and creates \"shell\" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. You can use this intent to preview updates to deployments or preview new deployments. You must provide a target.config with a configuration for this intent. After previewing a deployment, you can deploy your resources by making a request with the UPDATE intent or you can CANCEL the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.\n\nUPDATE performs an update to the underlying resources in a deployment. If you provide a populated target.config field with this request, Deployment Manager uses that configuration to perform an update. If you had previewed this update beforehand, and do not supply a target.config or provide an empty target.config, Deployment Manager uses the last previewed configuration.\n\nCANCEL cancels an update that is in PREVIEW or UPDATE but does not undo any changes already made." + }, + "manifest": { + "type": "string", + "description": "[Output Only] URL of the manifest representing the last manifest that was successfully deployed." + }, + "name": { + "type": "string", + "description": "The name of the deployment, which must be unique within the project." + }, + "state": { + "type": "string", + "description": "[Output Only] The current state of the deployment. This can be DEPLOYED, DEPLOYMENT_FAILED, PREVIEWING, UPDATING, and CANCELING." + }, + "target": { + "$ref": "TargetConfiguration", + "description": "[Input Only] The parameters that define your deployment, including the deployment configuration and relevant templates." + }, + "update": { + "$ref": "DeploymentUpdate", + "description": "[Output Only] If Deployment Manager is currently updating or previewing an update to this deployment, the updated configuration appears here." + }, + "updateTime": { + "type": "string", + "description": "[Output Only] Timestamp when the deployment was updated, in RFC3339 text format ." + } + } + }, + "DeploymentUpdate": { + "id": "DeploymentUpdate", + "type": "object", + "description": "", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] List of all errors encountered while trying to enact the update.", + "items": { + "type": "string" + } + }, + "manifest": { + "type": "string", + "description": "[Output Only] URL of the manifest representing the update configuration of this deployment." + } + } + }, + "DeploymentsListResponse": { + "id": "DeploymentsListResponse", + "type": "object", + "description": "A response containing a partial list of deployments and a page token used to build the next request if the request has been truncated.", + "properties": { + "deployments": { + "type": "array", + "description": "[Output Only] The deployments contained in this response.", + "items": { + "$ref": "Deployment" + } + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + } + } + }, + "ImportFile": { + "id": "ImportFile", + "type": "object", + "description": "", + "properties": { + "content": { + "type": "string", + "description": "The contents of the file." + }, + "name": { + "type": "string", + "description": "The name of the file." + } + } + }, + "Manifest": { + "id": "Manifest", + "type": "object", + "description": "", + "properties": { + "config": { + "type": "string", + "description": "[Output Only] The YAML configuration for this manifest." + }, + "evaluatedConfig": { + "type": "string", + "description": "[Output Only] The fully-expanded configuration file, including any templates and references." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "imports": { + "type": "array", + "description": "[Output Only] The imported files for this manifest.", + "items": { + "$ref": "ImportFile" + } + }, + "insertTime": { + "type": "string", + "description": "[Output Only] Timestamp when the manifest was created, in RFC3339 text format." + }, + "layout": { + "type": "string", + "description": "[Output Only] The YAML layout for this manifest." + }, + "name": { + "type": "string", + "description": "[Output Only] The name of the manifest." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Self link for the manifest." + } + } + }, + "ManifestsListResponse": { + "id": "ManifestsListResponse", + "type": "object", + "description": "A response containing a partial list of manifests and a page token used to build the next request if the request has been truncated.", + "properties": { + "manifests": { + "type": "array", + "description": "[Output Only] Manifests contained in this list response.", + "items": { + "$ref": "Manifest" + } + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "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." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This is in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors are generated during processing of the operation, this field will be populated.", + "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." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This is in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#Operation for Operation resources.", + "default": "deploymentmanager#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output Only] Type of the operation, such as insert, update, and delete." + }, + "progress": { + "type": "integer", + "description": "[Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only applicable for regional resources." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server. This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE." + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of the operation, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The warning type identifier for this warning." + }, + "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." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides." + } + } + }, + "OperationsListResponse": { + "id": "OperationsListResponse", + "type": "object", + "description": "A response containing a partial list of operations and a page token used to build the next request if the request has been truncated.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "operations": { + "type": "array", + "description": "[Output Only] Operations contained in this list response.", + "items": { + "$ref": "Operation" + } + } + } + }, + "Resource": { + "id": "Resource", + "type": "object", + "description": "", + "properties": { + "finalProperties": { + "type": "string", + "description": "[Output Only] The evaluated properties of the resource with references expanded. Returned as serialized YAML." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] Timestamp when the resource was created or acquired, in RFC3339 text format ." + }, + "manifest": { + "type": "string", + "description": "[Output Only] URL of the manifest representing the current configuration of this resource." + }, + "name": { + "type": "string", + "description": "[Output Only] The name of the resource as it appears in the YAML config." + }, + "properties": { + "type": "string", + "description": "[Output Only] The current properties of the resource before any references have been filled in. Returned as serialized YAML." + }, + "type": { + "type": "string", + "description": "[Output Only] The type of the resource, for example ?compute.v1.instance?, or ?replicaPools.v1beta2.instanceGroupManager?" + }, + "update": { + "$ref": "ResourceUpdate", + "description": "[Output Only] If Deployment Manager is currently updating or previewing an update to this resource, the updated configuration appears here." + }, + "updateTime": { + "type": "string", + "description": "[Output Only] Timestamp when the resource was updated, in RFC3339 text format ." + }, + "url": { + "type": "string", + "description": "[Output Only] The URL of the actual resource." + } + } + }, + "ResourceUpdate": { + "id": "ResourceUpdate", + "type": "object", + "description": "", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] List of all errors encountered while trying to enact update.intent.", + "items": { + "type": "string" + } + }, + "finalProperties": { + "type": "string", + "description": "[Output Only] The expanded properties of the resource with reference values expanded. Returned as serialized YAML." + }, + "intent": { + "type": "string", + "description": "[Output Only] The intent of the resource, PREVIEW, UPDATE, or CANCEL." + }, + "manifest": { + "type": "string", + "description": "[Output Only] URL of the manifest representing the update configuration of this resource." + }, + "properties": { + "type": "string", + "description": "[Output Only] The set of updated properties for this resource, before references are expanded. Returned as serialized YAML." + }, + "state": { + "type": "string", + "description": "[Output Only] The state of the resource." + } + } + }, + "ResourcesListResponse": { + "id": "ResourcesListResponse", + "type": "object", + "description": "A response containing a partial list of resources and a page token used to build the next request if the request has been truncated.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + }, + "resources": { + "type": "array", + "description": "Resources contained in this list response.", + "items": { + "$ref": "Resource" + } + } + } + }, + "TargetConfiguration": { + "id": "TargetConfiguration", + "type": "object", + "description": "", + "properties": { + "config": { + "type": "string", + "description": "The configuration to use for this deployment." + }, + "imports": { + "type": "array", + "description": "Specifies any files to import for this configuration. This can be used to import templates or other files. For example, you might import a text file in order to use the file in a template.", + "items": { + "$ref": "ImportFile" + } + } + } + }, + "Type": { + "id": "Type", + "type": "object", + "description": "A resource type supported by Deployment Manager.", + "properties": { + "name": { + "type": "string", + "description": "Name of the type." + } + } + }, + "TypesListResponse": { + "id": "TypesListResponse", + "type": "object", + "description": "A response that returns all Types supported by Deployment Manager", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + }, + "types": { + "type": "array", + "description": "[Output Only] A list of resource types supported by Deployment Manager.", + "items": { + "$ref": "Type" + } + } + } + } + }, + "resources": { + "deployments": { + "methods": { + "delete": { + "id": "deploymentmanager.deployments.delete", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "DELETE", + "description": "Deletes a deployment and all of the resources in the deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "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" + } + }, + "parameterOrder": [ + "project", + "deployment" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "deploymentmanager.deployments.get", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "GET", + "description": "Gets information about a specific deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "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" + } + }, + "parameterOrder": [ + "project", + "deployment" + ], + "response": { + "$ref": "Deployment" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "insert": { + "id": "deploymentmanager.deployments.insert", + "path": "{project}/global/deployments", + "httpMethod": "POST", + "description": "Creates a deployment and all of the resources described by the deployment manifest.", + "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" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "Deployment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "deploymentmanager.deployments.list", + "path": "{project}/global/deployments", + "httpMethod": "GET", + "description": "Lists all deployments for a given project.", + "parameters": { + "filter": { + "type": "string", + "description": "Filter expression for filtering listed resources.", + "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": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue 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": "DeploymentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "patch": { + "id": "deploymentmanager.deployments.patch", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "PATCH", + "description": "Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics.", + "parameters": { + "createPolicy": { + "type": "string", + "description": "Sets the policy to use for creating new resources.", + "default": "CREATE_OR_ACQUIRE", + "enum": [ + "ACQUIRE", + "CREATE_OR_ACQUIRE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "deletePolicy": { + "type": "string", + "description": "Sets the policy to use for deleting resources.", + "default": "DELETE", + "enum": [ + "ABANDON", + "DELETE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "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" + }, + "updatePolicy": { + "type": "string", + "description": "Sets the policy to use for updating resources.", + "default": "PATCH", + "enum": [ + "PATCH", + "UPDATE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "project", + "deployment" + ], + "request": { + "$ref": "Deployment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "update": { + "id": "deploymentmanager.deployments.update", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "PUT", + "description": "Updates a deployment and all of the resources described by the deployment manifest.", + "parameters": { + "createPolicy": { + "type": "string", + "description": "Sets the policy to use for creating new resources.", + "default": "CREATE_OR_ACQUIRE", + "enum": [ + "ACQUIRE", + "CREATE_OR_ACQUIRE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "deletePolicy": { + "type": "string", + "description": "Sets the policy to use for deleting resources.", + "default": "DELETE", + "enum": [ + "ABANDON", + "DELETE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "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" + }, + "updatePolicy": { + "type": "string", + "description": "Sets the policy to use for updating resources.", + "default": "PATCH", + "enum": [ + "PATCH", + "UPDATE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "project", + "deployment" + ], + "request": { + "$ref": "Deployment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + } + } + }, + "manifests": { + "methods": { + "get": { + "id": "deploymentmanager.manifests.get", + "path": "{project}/global/deployments/{deployment}/manifests/{manifest}", + "httpMethod": "GET", + "description": "Gets information about a specific manifest.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "manifest": { + "type": "string", + "description": "The name of the manifest for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "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" + } + }, + "parameterOrder": [ + "project", + "deployment", + "manifest" + ], + "response": { + "$ref": "Manifest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "list": { + "id": "deploymentmanager.manifests.list", + "path": "{project}/global/deployments/{deployment}/manifests", + "httpMethod": "GET", + "description": "Lists all manifests for a given deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "filter": { + "type": "string", + "description": "Filter expression for filtering listed resources.", + "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": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue 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", + "deployment" + ], + "response": { + "$ref": "ManifestsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "operations": { + "methods": { + "get": { + "id": "deploymentmanager.operations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Gets information about a specific operation.", + "parameters": { + "operation": { + "type": "string", + "description": "The name of the operation for this request.", + "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" + } + }, + "parameterOrder": [ + "project", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "list": { + "id": "deploymentmanager.operations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Lists all operations for a project.", + "parameters": { + "filter": { + "type": "string", + "description": "Filter expression for filtering listed resources.", + "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": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue 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": "OperationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "resources": { + "methods": { + "get": { + "id": "deploymentmanager.resources.get", + "path": "{project}/global/deployments/{deployment}/resources/{resource}", + "httpMethod": "GET", + "description": "Gets information about a single resource.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "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" + }, + "resource": { + "type": "string", + "description": "The name of the resource for this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "deployment", + "resource" + ], + "response": { + "$ref": "Resource" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "list": { + "id": "deploymentmanager.resources.list", + "path": "{project}/global/deployments/{deployment}/resources", + "httpMethod": "GET", + "description": "Lists all resources in a given deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "filter": { + "type": "string", + "description": "Filter expression for filtering listed resources.", + "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": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue 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", + "deployment" + ], + "response": { + "$ref": "ResourcesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "types": { + "methods": { + "list": { + "id": "deploymentmanager.types.list", + "path": "{project}/global/types", + "httpMethod": "GET", + "description": "Lists all resource types for Deployment Manager.", + "parameters": { + "filter": { + "type": "string", + "description": "Filter expression for filtering listed resources.", + "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": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue 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": "TypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + } + } +} diff --git a/etc/api/doubleclicksearch/v2/doubleclicksearch-api.json b/etc/api/doubleclicksearch/v2/doubleclicksearch-api.json index f414bfdf44..4c30c31cbe 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/Y1wjJXqKq4tUGkkWO6BLXXmKWiI\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ve8tEpbsG_IxtYaZBLsdJxUCrVI\"", "discoveryVersion": "v1", "id": "doubleclicksearch:v2", "name": "doubleclicksearch", "version": "v2", - "revision": "20150303", + "revision": "20150526", "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", @@ -158,20 +158,24 @@ }, "attributionModel": { "type": "string", - "description": "Attribution model name. This field is ignored." + "description": "This field is ignored." }, "campaignId": { "type": "string", "description": "DS campaign ID.", "format": "int64" }, + "channel": { + "type": "string", + "description": "Sales channel for the product. Acceptable values are: \n- \"local\": a physical store \n- \"online\": an online store" + }, "clickId": { "type": "string", "description": "DS click ID for the conversion." }, "conversionId": { "type": "string", - "description": "Advertiser-provided ID for the conversion, also known as the order ID.", + "description": "For offline conversions, this is an ID provided by advertisers. Advertisers can use this property to specify an ID that is meaningful to them. If an advertiser doesn't specify a conversionId, DoubleClick Search generates one. For online conversions, DS copies the dsConversionId or floodlightOrderId into this property depending on the advertiser's Floodlight instructions.", "annotations": { "required": [ "doubleclicksearch.conversion.insert" @@ -195,7 +199,7 @@ }, "countMillis": { "type": "string", - "description": "The number of conversions, formatted in millis (conversions multiplied by 1000). This field is ignored.", + "description": "This field is ignored.", "format": "int64" }, "criterionId": { @@ -221,9 +225,13 @@ "$ref": "CustomMetric" } }, + "deviceType": { + "type": "string", + "description": "The type of device on which the conversion occurred." + }, "dsConversionId": { "type": "string", - "description": "DS conversion ID.", + "description": "ID that DoubleClick Search generates for each conversion.", "format": "int64" }, "engineAccountId": { @@ -233,7 +241,29 @@ }, "floodlightOrderId": { "type": "string", - "description": "The advertiser-provided order id for the conversion." + "description": "The Floodlight order ID provided by the advertiser for the conversion." + }, + "inventoryAccountId": { + "type": "string", + "description": "ID that DS generates and uses to uniquely identify the inventory account that contains the product.", + "format": "int64" + }, + "productCountry": { + "type": "string", + "description": "The country registered for the Merchant Center feed that contains the product. Use an ISO 3166 code to specify a country." + }, + "productGroupId": { + "type": "string", + "description": "DS product group ID.", + "format": "int64" + }, + "productId": { + "type": "string", + "description": "The product ID (SKU)." + }, + "productLanguage": { + "type": "string", + "description": "The language registered for the Merchant Center feed that contains the product. Use an ISO 639 code to specify a language." }, "quantityMillis": { "type": "string", @@ -267,6 +297,10 @@ "type": "string", "description": "The state of the conversion, that is, either ACTIVE or REMOVED. Note: state DELETED is deprecated." }, + "storeId": { + "type": "string", + "description": "The ID of the local store for which the product was advertised. Applicable only when the channel is \"local\"." + }, "type": { "type": "string", "description": "The type of the conversion, that is, either ACTION or TRANSACTION. An ACTION conversion is an action by the user that has no monetarily quantifiable value, while a TRANSACTION conversion is an action that does have a monetarily quantifiable value. Examples are email list signups (ACTION) versus ecommerce purchases (TRANSACTION)." diff --git a/etc/api/drive/v1/drive-api.json b/etc/api/drive/v1/drive-api.json index 8b939e8668..a935c2dedb 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/iHP0-cMbS0-hNv8vs9Iw1IkniHE\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/rHeHaCJcqlwUUgfESgXN1mNQacA\"", "discoveryVersion": "v1", "id": "drive:v1", "name": "drive", "version": "v1", - "revision": "20150326", + "revision": "20150305", "title": "Drive API", "description": "The API to interact with Drive.", "ownerDomain": "google.com", @@ -70,7 +70,7 @@ "oauth2": { "scopes": { "https://www.googleapis.com/auth/drive.file": { - "description": "View and manage Google Drive files that you have opened or created with this app" + "description": "View and manage Google Drive files and folders that you have opened or created with this app" } } } @@ -321,7 +321,7 @@ }, "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 revisions are preserved (causing increased use of the user's data storage quota).", + "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.", "default": "true", "location": "query" }, @@ -365,7 +365,7 @@ }, "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 revisions are preserved (causing increased use of the user's data storage quota).", + "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.", "default": "true", "location": "query" }, diff --git a/etc/api/drive/v2/drive-api.json b/etc/api/drive/v2/drive-api.json index d8ef297d47..7a7df93cc5 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/q7G5QdguNPp3b-d0oF62ZLMOZNU\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/KEeW0PsH1Koyy8hFKaOTlOvpjfI\"", "discoveryVersion": "v1", "id": "drive:v2", "name": "drive", "version": "v2", - "revision": "20150326", + "revision": "20150305", "title": "Drive API", "description": "The API to interact with Drive.", "ownerDomain": "google.com", @@ -79,7 +79,7 @@ "description": "View your Google Drive apps" }, "https://www.googleapis.com/auth/drive.file": { - "description": "View and manage Google Drive files that you have opened or created with this app" + "description": "View and manage Google Drive files and folders that you have opened or created with this app" }, "https://www.googleapis.com/auth/drive.metadata": { "description": "View and manage metadata of files in your Google Drive" @@ -137,7 +137,7 @@ }, "domainSharingPolicy": { "type": "string", - "description": "The domain sharing policy for the current user." + "description": "The domain sharing policy for the current user. Possible values are: \n- ALLOWED \n- ALLOWED_WITH_WARNING \n- INCOMING_ONLY \n- DISALLOWED" }, "etag": { "type": "string", @@ -1223,6 +1223,13 @@ "$ref": "User", "description": "User that shared the item with the current user, if available." }, + "spaces": { + "type": "array", + "description": "The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.", + "items": { + "type": "string" + } + }, "thumbnail": { "type": "object", "description": "Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.", @@ -1885,6 +1892,11 @@ "description": "Page token for changes.", "location": "query" }, + "spaces": { + "type": "string", + "description": "A comma-separated list of spaces to query. Supported values are 'drive' and 'appDataFolder'.", + "location": "query" + }, "startChangeId": { "type": "string", "description": "Change ID to start listing changes from.", @@ -1937,6 +1949,11 @@ "description": "Page token for changes.", "location": "query" }, + "spaces": { + "type": "string", + "description": "A comma-separated list of spaces to query. Supported values are 'drive' and 'appDataFolder'.", + "location": "query" + }, "startChangeId": { "type": "string", "description": "Change ID to start listing changes from.", @@ -2155,8 +2172,7 @@ ], "scopes": [ "https://www.googleapis.com/auth/drive", - "https://www.googleapis.com/auth/drive.file", - "https://www.googleapis.com/auth/drive.readonly" + "https://www.googleapis.com/auth/drive.file" ] }, "get": { @@ -2372,7 +2388,7 @@ }, "ocrLanguage": { "type": "string", - "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", + "description": "If ocr is true, hints at the language to use. Valid values are BCP 47 codes.", "location": "query" }, "pinned": { @@ -2534,7 +2550,7 @@ }, "ocrLanguage": { "type": "string", - "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", + "description": "If ocr is true, hints at the language to use. Valid values are BCP 47 codes.", "location": "query" }, "pinned": { @@ -2654,6 +2670,11 @@ "type": "string", "description": "Query string for searching files.", "location": "query" + }, + "spaces": { + "type": "string", + "description": "A comma-separated list of spaces to query. Supported values are 'drive' and 'appDataFolder'.", + "location": "query" } }, "response": { @@ -2694,7 +2715,7 @@ }, "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 revisions are preserved (causing increased use of the user's data storage quota).", + "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.", "default": "true", "location": "query" }, @@ -2706,7 +2727,7 @@ }, "ocrLanguage": { "type": "string", - "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", + "description": "If ocr is true, hints at the language to use. Valid values are BCP 47 codes.", "location": "query" }, "pinned": { @@ -2871,7 +2892,7 @@ }, "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 revisions are preserved (causing increased use of the user's data storage quota).", + "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.", "default": "true", "location": "query" }, @@ -2883,7 +2904,7 @@ }, "ocrLanguage": { "type": "string", - "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", + "description": "If ocr is true, hints at the language to use. Valid values are BCP 47 codes.", "location": "query" }, "pinned": { diff --git a/etc/api/fitness/v1/fitness-api.json b/etc/api/fitness/v1/fitness-api.json index c4b596b095..cac97fa784 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/NViEYVhdyE08LWyL01EX31ABjdw\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ON1-o8QnfSjPgDpi2fa5Rxma0qA\"", "discoveryVersion": "v1", "id": "fitness:v1", "name": "fitness", "version": "v1", - "revision": "20150326", + "revision": "20150527", "title": "Fitness", "description": "Google Fit API", "ownerDomain": "google.com", @@ -91,6 +91,119 @@ } }, "schemas": { + "AggregateBucket": { + "id": "AggregateBucket", + "type": "object", + "properties": { + "activity": { + "type": "integer", + "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", + "items": { + "$ref": "Dataset" + } + }, + "endTimeMillis": { + "type": "string", + "format": "int64" + }, + "session": { + "$ref": "Session", + "description": "available for Bucket.Type.SESSION" + }, + "startTimeMillis": { + "type": "string", + "format": "int64" + }, + "type": { + "type": "string", + "description": "The type of a bucket signifies how the data aggregation is performed in the bucket.", + "enum": [ + "activitySegment", + "activityType", + "session", + "time", + "unknown" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "AggregateBy": { + "id": "AggregateBy", + "type": "object", + "properties": { + "dataSourceId": { + "type": "string" + }, + "dataTypeName": { + "type": "string", + "description": "by dataype or by datasource" + }, + "outputDataSourceId": { + "type": "string" + }, + "outputDataTypeName": { + "type": "string" + } + } + }, + "AggregateRequest": { + "id": "AggregateRequest", + "type": "object", + "properties": { + "aggregateBy": { + "type": "array", + "items": { + "$ref": "AggregateBy" + } + }, + "bucketByActivitySegment": { + "$ref": "BucketByActivity" + }, + "bucketByActivityType": { + "$ref": "BucketByActivity" + }, + "bucketBySession": { + "$ref": "BucketBySession" + }, + "bucketByTime": { + "$ref": "BucketByTime", + "description": "apparently oneof is not supported by reduced_nano_proto" + }, + "endTimeMillis": { + "type": "string", + "format": "int64" + }, + "startTimeMillis": { + "type": "string", + "description": "required time range", + "format": "int64" + } + } + }, + "AggregateResponse": { + "id": "AggregateResponse", + "type": "object", + "properties": { + "bucket": { + "type": "array", + "items": { + "$ref": "AggregateBucket" + } + } + } + }, "Application": { "id": "Application", "type": "object", @@ -121,6 +234,42 @@ } } }, + "BucketByActivity": { + "id": "BucketByActivity", + "type": "object", + "properties": { + "activityDataSourceId": { + "type": "string", + "description": "default activity stream will be used if not specified" + }, + "minDurationMillis": { + "type": "string", + "description": "Only activity segments of duration longer than this is used", + "format": "int64" + } + } + }, + "BucketBySession": { + "id": "BucketBySession", + "type": "object", + "properties": { + "minDurationMillis": { + "type": "string", + "description": "Only sessions of duration longer than this is used", + "format": "int64" + } + } + }, + "BucketByTime": { + "id": "BucketByTime", + "type": "object", + "properties": { + "durationMillis": { + "type": "string", + "format": "int64" + } + } + }, "DataPoint": { "id": "DataPoint", "type": "object", @@ -955,6 +1104,31 @@ } } }, + "dataset": { + "methods": { + "aggregate": { + "id": "fitness.users.dataset.aggregate", + "path": "{userId}/dataset:aggregate", + "httpMethod": "POST", + "parameters": { + "userId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "AggregateRequest" + }, + "response": { + "$ref": "AggregateResponse" + } + } + } + }, "sessions": { "methods": { "delete": { diff --git a/etc/api/games/v1/games-api.json b/etc/api/games/v1/games-api.json index de55bb4d47..e8871f6d5e 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/6wWOyzUyIV1QXGfj7Laljr6yta8\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/mrz_UffhvFtAEj5vHgLDFJrlEO4\"", "discoveryVersion": "v1", "id": "games:v1", "name": "games", "canonicalName": "Games", "version": "v1", - "revision": "20150413", + "revision": "20150601", "title": "Google Play Game Services API", "description": "The API for Google Play Game Services.", "ownerDomain": "google.com", diff --git a/etc/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json b/etc/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json index b243283899..13f99d9bdb 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/1lytpOAcJYjccK3uufWMlKFi1ZU\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/x7h1W7MHWqOKw-Ox_tyfV04C-F0\"", "discoveryVersion": "v1", "id": "gamesConfiguration:v1configuration", "name": "gamesConfiguration", "canonicalName": "Games Configuration", "version": "v1configuration", - "revision": "20150413", + "revision": "20150601", "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 df5f39ce22..8e6daebaba 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/arP5fSrBqJ1jS7apXYHDTKjArfA\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/oC18PbFsOPKgTlxUwLIUeBOrwcY\"", "discoveryVersion": "v1", "id": "gamesManagement:v1management", "name": "gamesManagement", "canonicalName": "Games Management", "version": "v1management", - "revision": "20150413", + "revision": "20150601", "title": "Google Play Game Services Management API", "description": "The Management API for Google Play Game Services.", "ownerDomain": "google.com", diff --git a/etc/api/genomics/v1/genomics-api.json b/etc/api/genomics/v1/genomics-api.json new file mode 100644 index 0000000000..e6ad6a7477 --- /dev/null +++ b/etc/api/genomics/v1/genomics-api.json @@ -0,0 +1,103 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/78ZDw2UBdovyKdzpDDyo3AbROrQ\"", + "discoveryVersion": "v1", + "id": "genomics:v1", + "name": "genomics", + "version": "v1", + "revision": "20150615", + "title": "Genomics API", + "description": "An API to store, process, explore, and share DNA sequence reads, reference-based alignments, and variant calls.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "", + "protocol": "rest", + "baseUrl": "https://genomics.googleapis.com/", + "basePath": "", + "rootUrl": "https://genomics.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + } +} diff --git a/etc/api/genomics/v1beta2/genomics-api.json b/etc/api/genomics/v1beta2/genomics-api.json index b27bb326e6..349c9e665f 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/j8Y-s44WXRWtA7sjAxaOKh9K17Q\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/5Ip5gxD2IW-n7qngRG7WOKp94TA\"", "discoveryVersion": "v1", "id": "genomics:v1beta2", "name": "genomics", "version": "v1beta2", - "revision": "20150326", + "revision": "20150618", "title": "Genomics API", "description": "Provides access to Genomics data.", "ownerDomain": "google.com", @@ -72,6 +72,9 @@ "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" }, @@ -141,7 +144,7 @@ }, "info": { "type": "object", - "description": "A map of additional data for this annotation.", + "description": "A string which maps to an array of values.", "additionalProperties": { "type": "array", "description": "A string which maps to an array of values.", @@ -199,7 +202,7 @@ }, "info": { "type": "object", - "description": "A map of additional data for this annotation set.", + "description": "A string which maps to an array of values.", "additionalProperties": { "type": "array", "description": "A string which maps to an array of values.", @@ -325,7 +328,7 @@ }, "info": { "type": "object", - "description": "A map of additional variant call information.", + "description": "A string which maps to an array of values.", "additionalProperties": { "type": "array", "description": "A string which maps to an array of values.", @@ -389,7 +392,7 @@ }, "info": { "type": "object", - "description": "A map of additional call set information.", + "description": "A string which maps to an array of values.", "additionalProperties": { "type": "array", "description": "A string which maps to an array of values.", @@ -479,6 +482,11 @@ "type": "object", "description": "A Dataset is a collection of genomic data.", "properties": { + "createTime": { + "type": "string", + "description": "The time this dataset was created, in seconds from the epoch.", + "format": "int64" + }, "id": { "type": "string", "description": "The Google generated ID of the dataset, immutable." @@ -554,16 +562,16 @@ "properties": { "exportUri": { "type": "string", - "description": "A Google Cloud Storage URI for the exported BAM file. The currently authenticated user must have write access to the new file. An error will be returned if the URI already contains data." + "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." }, "projectNumber": { "type": "string", - "description": "The Google Developers Console project number that owns this export.", + "description": "Required. The Google Developers Console project number that owns this export.", "format": "int64" }, "readGroupSetIds": { "type": "array", - "description": "The IDs of the read group sets to export.", + "description": "Required. The IDs of the read group sets to export.", "items": { "type": "string" } @@ -595,11 +603,11 @@ "properties": { "bigqueryDataset": { "type": "string", - "description": "The BigQuery dataset to export data to. Note that this is distinct from the Genomics concept of \"dataset\"." + "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": "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." + "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." }, "callSetIds": { "type": "array", @@ -620,7 +628,7 @@ }, "projectNumber": { "type": "string", - "description": "The Google Cloud project number that owns the destination BigQuery dataset. The caller must have WRITE access to this project. This project will also own the resulting export job.", + "description": "Required. The Google Cloud project number 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": "int64" } } @@ -729,7 +737,7 @@ "properties": { "format": { "type": "string", - "description": "The format of the variant data being imported.", + "description": "The format of the variant data being imported. If unspecified, defaults to to \"VCF\".", "enum": [ "COMPLETE_GENOMICS", "VCF" @@ -739,9 +747,13 @@ "" ] }, + "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\"." + }, "sourceUris": { "type": "array", - "description": "A list of URIs pointing at VCF files in Google Cloud Storage. See the VCF Specification for more details on the input format.", + "description": "A list of URIs referencing variant files in Google Cloud Storage. URIs can include wildcards as described here. Note that recursive wildcards ('**') are not supported.", "items": { "type": "string" } @@ -762,7 +774,7 @@ "Int32Value": { "id": "Int32Value", "type": "object", - "description": "Wrapper message for int32.", + "description": "Wrapper message for `int32`.\n\nThe JSON representation for `Int32Value` is JSON number.", "properties": { "value": { "type": "integer", @@ -906,6 +918,24 @@ } } }, + "KeyValue": { + "id": "KeyValue", + "type": "object", + "description": "Used to hold basic key value information.", + "properties": { + "key": { + "type": "string", + "description": "A string which maps to an array of values." + }, + "value": { + "type": "array", + "description": "The string values.", + "items": { + "type": "string" + } + } + } + }, "LinearAlignment": { "id": "LinearAlignment", "type": "object", @@ -1016,7 +1046,7 @@ }, "info": { "type": "object", - "description": "Remaining structured metadata key-value pairs.", + "description": "A string which maps to an array of values.", "additionalProperties": { "type": "array", "description": "A string which maps to an array of values.", @@ -1223,7 +1253,7 @@ }, "info": { "type": "object", - "description": "A map of additional read alignment information.", + "description": "A string which maps to an array of values.", "additionalProperties": { "type": "array", "description": "A string which maps to an array of values.", @@ -1291,7 +1321,7 @@ }, "info": { "type": "object", - "description": "A map of additional read group information.", + "description": "A string which maps to an array of values.", "additionalProperties": { "type": "array", "description": "A string which maps to an array of values.", @@ -1393,7 +1423,7 @@ }, "info": { "type": "object", - "description": "A map of additional read group set information.", + "description": "A string which maps to an array of values.", "additionalProperties": { "type": "array", "description": "A string which maps to an array of values.", @@ -2045,7 +2075,7 @@ }, "variantSetIds": { "type": "array", - "description": "Exactly one variant set ID must be provided. Only variants from this variant set will be returned.", + "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" } @@ -2070,45 +2100,6 @@ } } }, - "StreamReadsRequest": { - "id": "StreamReadsRequest", - "type": "object", - "properties": { - "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" - }, - "readGroupSetIds": { - "type": "array", - "description": "The ID of the read groups set within which to search for reads. Exactly one ID must be provided.", - "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" - } - } - }, - "StreamReadsResponse": { - "id": "StreamReadsResponse", - "type": "object", - "properties": { - "alignments": { - "type": "array", - "items": { - "$ref": "Read" - } - } - } - }, "Transcript": { "id": "Transcript", "type": "object", @@ -2209,7 +2200,7 @@ }, "info": { "type": "object", - "description": "A map of additional variant information.", + "description": "A string which maps to an array of values.", "additionalProperties": { "type": "array", "description": "A string which maps to an array of values.", @@ -2438,6 +2429,7 @@ "$ref": "AnnotationSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2458,6 +2450,7 @@ "annotationSetId" ], "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2481,6 +2474,7 @@ "$ref": "AnnotationSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -2508,6 +2502,7 @@ "$ref": "AnnotationSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2523,6 +2518,7 @@ "$ref": "SearchAnnotationSetsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -2550,6 +2546,7 @@ "$ref": "AnnotationSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] } @@ -2569,6 +2566,7 @@ "$ref": "BatchAnnotationsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2584,6 +2582,7 @@ "$ref": "Annotation" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2604,6 +2603,7 @@ "annotationId" ], "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2627,6 +2627,7 @@ "$ref": "Annotation" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -2654,6 +2655,7 @@ "$ref": "Annotation" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2669,6 +2671,7 @@ "$ref": "SearchAnnotationsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -2696,6 +2699,7 @@ "$ref": "Annotation" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] } @@ -2715,6 +2719,7 @@ "$ref": "CallSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2735,6 +2740,7 @@ "callSetId" ], "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2758,6 +2764,7 @@ "$ref": "CallSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -2785,6 +2792,7 @@ "$ref": "CallSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2800,6 +2808,7 @@ "$ref": "SearchCallSetsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -2827,6 +2836,7 @@ "$ref": "CallSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] } @@ -2846,6 +2856,7 @@ "$ref": "Dataset" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2866,6 +2877,7 @@ "datasetId" ], "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2889,6 +2901,7 @@ "$ref": "Dataset" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -2921,6 +2934,7 @@ "$ref": "ListDatasetsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -2948,6 +2962,7 @@ "$ref": "Dataset" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2971,6 +2986,7 @@ "$ref": "Dataset" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -2997,6 +3013,7 @@ "$ref": "Dataset" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] } @@ -3018,6 +3035,7 @@ "$ref": "ExperimentalCreateJobResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/genomics" ] @@ -3045,6 +3063,7 @@ "jobId" ], "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -3068,6 +3087,7 @@ "$ref": "Job" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3084,6 +3104,7 @@ "$ref": "SearchJobsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3104,6 +3125,7 @@ "$ref": "AlignReadGroupSetsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/genomics" ] @@ -3120,6 +3142,7 @@ "$ref": "CallReadGroupSetsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/genomics" ] @@ -3141,6 +3164,7 @@ "readGroupSetId" ], "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -3156,6 +3180,7 @@ "$ref": "ExportReadGroupSetsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/genomics" ] @@ -3180,6 +3205,7 @@ "$ref": "ReadGroupSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3196,6 +3222,7 @@ "$ref": "ImportReadGroupSetsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/genomics" ] @@ -3223,6 +3250,7 @@ "$ref": "ReadGroupSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -3238,6 +3266,7 @@ "$ref": "SearchReadGroupSetsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3265,6 +3294,7 @@ "$ref": "ReadGroupSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] } @@ -3326,6 +3356,7 @@ "$ref": "ListCoverageBucketsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3348,6 +3379,7 @@ "$ref": "SearchReadsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3376,6 +3408,7 @@ "$ref": "Reference" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3392,6 +3425,7 @@ "$ref": "SearchReferencesResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3443,6 +3477,7 @@ "$ref": "ListBasesResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3473,6 +3508,7 @@ "$ref": "ReferenceSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3489,28 +3525,13 @@ "$ref": "SearchReferenceSetsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] } } }, - "streamingReadstore": { - "methods": { - "streamreads": { - "id": "genomics.streamingReadstore.streamreads", - "path": "streamingReadstore/streamreads", - "httpMethod": "POST", - "description": "Gets a stream 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.\n\nIf a target positional range is specified, all reads whose alignment to the reference genome overlap the range are returned.\n\nAll reads returned are ordered by genomic coordinate (reference sequence & position). Reads with equivalent genomic coordinates are returned in a deterministic order.", - "request": { - "$ref": "StreamReadsRequest" - }, - "response": { - "$ref": "StreamReadsResponse" - } - } - } - }, "variants": { "methods": { "create": { @@ -3525,6 +3546,7 @@ "$ref": "Variant" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -3545,6 +3567,7 @@ "variantId" ], "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -3568,6 +3591,7 @@ "$ref": "Variant" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3584,6 +3608,7 @@ "$ref": "SearchVariantsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3611,6 +3636,7 @@ "$ref": "Variant" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] } @@ -3635,6 +3661,7 @@ "variantSetId" ], "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -3662,6 +3689,7 @@ }, "scopes": [ "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -3685,6 +3713,7 @@ "$ref": "VariantSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3712,6 +3741,7 @@ "$ref": "ImportVariantsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/genomics" ] @@ -3736,6 +3766,7 @@ "$ref": "MergeVariantsRequest" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -3747,7 +3778,7 @@ "parameters": { "variantSetId": { "type": "string", - "description": "The ID of the variant to be updated.", + "description": "The ID of the variant to be updated (must already exist).", "required": true, "location": "path" } @@ -3762,6 +3793,7 @@ "$ref": "VariantSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] }, @@ -3777,6 +3809,7 @@ "$ref": "SearchVariantSetsResponse" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ] @@ -3789,7 +3822,7 @@ "parameters": { "variantSetId": { "type": "string", - "description": "The ID of the variant to be updated.", + "description": "The ID of the variant to be updated (must already exist).", "required": true, "location": "path" } @@ -3804,6 +3837,7 @@ "$ref": "VariantSet" }, "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ] } diff --git a/etc/api/gmail/v1/gmail-api.json b/etc/api/gmail/v1/gmail-api.json index 5f7aae36a9..f75e87e24f 100644 --- a/etc/api/gmail/v1/gmail-api.json +++ b/etc/api/gmail/v1/gmail-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/hFGSutIVQj0PQfQgMG3Y44JNJU0\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/rcmL92SXMKTyKvGjL_5VhC8zz9s\"", "discoveryVersion": "v1", "id": "gmail:v1", "name": "gmail", "version": "v1", - "revision": "20150303", + "revision": "20150526", "title": "Gmail API", "description": "The Gmail REST API.", "ownerDomain": "google.com", @@ -419,6 +419,11 @@ "type": "string", "description": "The immutable ID of the message." }, + "internalDate": { + "type": "string", + "description": "The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header.", + "format": "int64" + }, "labelIds": { "type": "array", "description": "List of IDs of labels applied to this message.", @@ -622,6 +627,53 @@ "description": "A short part of the message text." } } + }, + "WatchRequest": { + "id": "WatchRequest", + "type": "object", + "description": "Set up or update a new push notification watch on this user's mailbox.", + "properties": { + "labelFilterAction": { + "type": "string", + "description": "Filtering behavior of labelIds list specified.", + "enum": [ + "exclude", + "include" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "labelIds": { + "type": "array", + "description": "List of label_ids to restrict notifications about. By default, if unspecified, all changes are pushed out. If specified then dictates which labels are required for a push notification to be generated.", + "items": { + "type": "string" + } + }, + "topicName": { + "type": "string", + "description": "A fully qualified Google Cloud Pub/Sub API topic name to publish the events to. This topic name **must** already exist in Cloud Pub/Sub and you **must** have already granted gmail \"publish\" permission on it. For example, \"projects/my-project-identifier/topics/my-topic-name\" (using the new Cloud Pub/Sub \"v1beta2\" topic naming format).\n\nNote that the \"my-project-identifier\" portion must exactly match your Google developer project id (the one executing this watch request)." + } + } + }, + "WatchResponse": { + "id": "WatchResponse", + "type": "object", + "description": "Push notification watch response.", + "properties": { + "expiration": { + "type": "string", + "description": "When Gmail will stop sending notifications for mailbox updates (epoch millis). Call watch again before this time to renew the watch.", + "format": "int64" + }, + "historyId": { + "type": "string", + "description": "The ID of the mailbox's current history record.", + "format": "uint64" + } + } } }, "resources": { @@ -653,6 +705,58 @@ "https://www.googleapis.com/auth/gmail.modify", "https://www.googleapis.com/auth/gmail.readonly" ] + }, + "stop": { + "id": "gmail.users.stop", + "path": "{userId}/stop", + "httpMethod": "POST", + "description": "Stop receiving push notifications for the given user mailbox.", + "parameters": { + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + }, + "watch": { + "id": "gmail.users.watch", + "path": "{userId}/watch", + "httpMethod": "POST", + "description": "Set up or update a push notification watch on the given user mailbox.", + "parameters": { + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "WatchRequest" + }, + "response": { + "$ref": "WatchResponse" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] } }, "resources": { @@ -953,7 +1057,7 @@ }, "startHistoryId": { "type": "string", - "description": "Required. Returns history records after the specified startHistoryId. The supplied startHistoryId should be obtained from the historyId of a message, thread, or previous list response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId typically returns an HTTP 404 error code. A historyId is typically valid for at least a week, but in some circumstances may be valid for only a few hours. If you receive an HTTP 404 error response, your application should perform a full sync. If you receive no nextPageToken in the response, there are no updates to retrieve and you can store the returned historyId for a future request.", + "description": "Required. Returns history records after the specified startHistoryId. The supplied startHistoryId should be obtained from the historyId of a message, thread, or previous list response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId typically returns an HTTP 404 error code. A historyId is typically valid for at least a week, but in some rare circumstances may be valid for only a few hours. If you receive an HTTP 404 error response, your application should perform a full sync. If you receive no nextPageToken in the response, there are no updates to retrieve and you can store the returned historyId for a future request.", "format": "uint64", "location": "query" }, diff --git a/etc/api/identitytoolkit/v3/identitytoolkit-api.json b/etc/api/identitytoolkit/v3/identitytoolkit-api.json index 9930131bc1..b35c94bd8e 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/c9gT3rNuoajJVcPy4DAj8Wu9bSM\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Xnfg-4IS066IVT9k9SbG9wAvQdM\"", "discoveryVersion": "v1", "id": "identitytoolkit:v3", "name": "identitytoolkit", "canonicalName": "Identity Toolkit", "version": "v3", - "revision": "20150406", + "revision": "20150513", "title": "Google Identity Toolkit API", "description": "Help the third party sites to implement federated login.", "ownerDomain": "google.com", @@ -333,6 +333,10 @@ "type": "string", "description": "Response to the captcha." }, + "disableUser": { + "type": "boolean", + "description": "Whether to disable the user." + }, "displayName": { "type": "string", "description": "The name of the user." @@ -371,6 +375,11 @@ "upgradeToFederatedLogin": { "type": "boolean", "description": "Mark the user to upgrade to federated login." + }, + "validSince": { + "type": "string", + "description": "Timestamp in seconds for valid login token.", + "format": "int64" } } }, @@ -598,6 +607,10 @@ "type": "object", "description": "Template for an individual account info.", "properties": { + "disabled": { + "type": "boolean", + "description": "Whether the user is disabled." + }, "displayName": { "type": "string", "description": "The name of the user." @@ -658,6 +671,11 @@ "description": "The user's password salt.", "format": "byte" }, + "validSince": { + "type": "string", + "description": "Timestamp in seconds for valid login token.", + "format": "int64" + }, "version": { "type": "integer", "description": "Version of the user's password.", diff --git a/etc/api/licensing/v1/licensing-api.json b/etc/api/licensing/v1/licensing-api.json index b1cfd1847a..50152ae72f 100644 --- a/etc/api/licensing/v1/licensing-api.json +++ b/etc/api/licensing/v1/licensing-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/chZbfEJA0-TN8tTaZIdtXJErZX4\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/u-ee2-YyMMLghYYje2dMcFaJBaE\"", "discoveryVersion": "v1", "id": "licensing:v1", "name": "licensing", "version": "v1", - "revision": "20140122", + "revision": "20150525", "title": "Enterprise License Manager API", "description": "Licensing API to view and manage license for your domain.", "ownerDomain": "google.com", diff --git a/etc/api/mapsengine/exp2/mapsengine-api.json b/etc/api/mapsengine/exp2/mapsengine-api.json index f5c9efee47..3328c0461d 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/XhF2xx0Lfoiz5ESiVXN4QpScCGc\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/8oOHNt5Z8JBzECjRSkqiQAiaen0\"", "discoveryVersion": "v1", "id": "mapsengine:exp2", "name": "mapsengine", "canonicalName": "Maps Engine", "version": "exp2", - "revision": "20150414", + "revision": "20150611", "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 664b8754be..70868a58f7 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/kLKyGogYDuC1m34RldogSlxPPMQ\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/L-PdcZxSM_jnMBtOdR1xH2_5Kvk\"", "discoveryVersion": "v1", "id": "mapsengine:v1", "name": "mapsengine", "canonicalName": "Maps Engine", "version": "v1", - "revision": "20150414", + "revision": "20150611", "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/mirror/v1/mirror-api.json b/etc/api/mirror/v1/mirror-api.json index 59524098da..4b292f9ad3 100644 --- a/etc/api/mirror/v1/mirror-api.json +++ b/etc/api/mirror/v1/mirror-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/bzmWA2xIEvQJRAH0k0bKxD0O1Uo\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/TaU9owdCZD7i0BuO1A_nVxyBOqs\"", "discoveryVersion": "v1", "id": "mirror:v1", "name": "mirror", "version": "v1", - "revision": "20150220", + "revision": "20150326", "title": "Google Mirror API", "description": "API for interacting with Glass users via the timeline.", "ownerDomain": "google.com", diff --git a/etc/api/oauth2/v1/oauth2-api.json b/etc/api/oauth2/v1/oauth2-api.json index fb0a63fd7e..4ee585d44a 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/x2QBsuiKT4nkMzUF8gequOfNOyQ\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/yBXWUg3_16xGrw-wakFJ4iOdZt0\"", "discoveryVersion": "v1", "id": "oauth2:v1", "name": "oauth2", "version": "v1", - "revision": "20150416", + "revision": "20150526", "title": "Google OAuth2 API", "description": "Lets you access OAuth2 protocol related APIs.", "ownerDomain": "google.com", diff --git a/etc/api/oauth2/v2/oauth2-api.json b/etc/api/oauth2/v2/oauth2-api.json index 499d6259e9..d0a31f9474 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/vIZCM-aeEhcCtmulcHwknl3f2rE\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/rnj_scS00W_RQszceDwCfUJUSKk\"", "discoveryVersion": "v1", "id": "oauth2:v2", "name": "oauth2", "version": "v2", - "revision": "20150416", + "revision": "20150526", "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 a8ef170480..e47d7f8522 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/ORNICSF2Z1YjV7yMXdU4V945lGo\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/00M-qZjkQ13qgsdq5akamAJBPOQ\"", "discoveryVersion": "v1", "id": "plus:v1", "name": "plus", "version": "v1", - "revision": "20150303", + "revision": "20150616", "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 e9aee4fda5..441e67116f 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/pzJb3bipFURG3pTFQAI_x_KdTEY\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ejQnj8VHVMpn-Gq4BhGLmqZIhZI\"", "discoveryVersion": "v1", "id": "plusDomains:v1", "name": "plusDomains", "version": "v1", - "revision": "20150303", + "revision": "20150616", "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/v1beta1/pubsub-api.json b/etc/api/pubsub/v1beta1/pubsub-api.json index c03aca2ccf..2aac2a8850 100644 --- a/etc/api/pubsub/v1beta1/pubsub-api.json +++ b/etc/api/pubsub/v1beta1/pubsub-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ZlS39JHAlE8Q0nTYVAdz5dw63po\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/GpjpDLvjZHTVKwwIavBHfgQL16c\"", "discoveryVersion": "v1", "id": "pubsub:v1beta1", "name": "pubsub", "version": "v1beta1", - "revision": "20150223", + "revision": "20150326", "title": "Google Cloud Pub/Sub API", "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", "ownerDomain": "google.com", @@ -168,11 +168,18 @@ }, "ackId": { "type": "string", - "description": "The acknowledgment ID." + "description": "The acknowledgment ID. Either this or ack_ids must be populated, not both." + }, + "ackIds": { + "type": "array", + "description": "List of acknowledgment IDs. Either this field or ack_id should be populated, not both. TODO(handrei): mark the above field deprecated once it's not used internally.", + "items": { + "type": "string" + } }, "subscription": { "type": "string", - "description": "The name of the subscription from which messages are being pulled." + "description": "Next Index: 5 The name of the subscription from which messages are being pulled." } } }, @@ -366,7 +373,7 @@ "properties": { "ackDeadlineSeconds": { "type": "integer", - "description": "For either push or pull delivery, the value is the maximum time after a subscriber receives a message before the subscriber should acknowledge or Nack the message. If the Ack deadline for a message passes without an Ack or a Nack, the Pub/Sub system will eventually redeliver the message. If a subscriber acknowledges after the deadline, the Pub/Sub system may accept the Ack, but it is possible that the message has been already delivered again. Multiple Acks to the message are allowed and will succeed.\n\nFor push delivery, this value is used to set the request timeout for the call to the push endpoint.\n\nFor pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for a specific pull request (message) with ModifyAckDeadline. While a message is outstanding (i.e. it has been delivered to a pull subscriber and the subscriber has not yet Acked or Nacked), the Pub/Sub system will not deliver that message to another pull subscriber (on a best-effort basis).", + "description": "For either push or pull delivery, the value is the maximum time after a subscriber receives a message before the subscriber should acknowledge or Nack the message. If the Ack deadline for a message passes without an Ack or a Nack, the Pub/Sub system will eventually redeliver the message. If a subscriber acknowledges after the deadline, the Pub/Sub system may accept the Ack, but it is possible that the message has been already delivered again. Multiple Acks to the message are allowed and will succeed.\n\nFor push delivery, this value is used to set the request timeout for the call to the push endpoint.\n\nFor pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for each message using its corresponding ack_id with ModifyAckDeadline. While a message is outstanding (i.e. it has been delivered to a pull subscriber and the subscriber has not yet Acked or Nacked), the Pub/Sub system will not deliver that message to another pull subscriber (on a best-effort basis).", "format": "int32" }, "name": { diff --git a/etc/api/pubsub/v1beta1a/pubsub-api.json b/etc/api/pubsub/v1beta1a/pubsub-api.json index 7ee5915be9..bb20aaf126 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/GLBm_Zx9lfMexTYRyeS3dLRfGVc\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/7dF_Pdkn9CaqP2VR3Xvya3Y17a8\"", "discoveryVersion": "v1", "id": "pubsub:v1beta1a", "name": "pubsub", "version": "v1beta1a", - "revision": "20150326", + "revision": "20150427", "title": "Google Cloud Pub/Sub API", "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", "ownerDomain": "google.com", @@ -14,26 +14,40 @@ "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" }, - "documentationLink": "", + "documentationLink": "https://cloud.google.com/pubsub/docs", "protocol": "rest", - "baseUrl": "https://pubsub.googleapis.com/v1beta1a/", - "basePath": "/v1beta1a/", + "baseUrl": "https://pubsub.googleapis.com/", + "basePath": "", "rootUrl": "https://pubsub.googleapis.com/", - "servicePath": "v1beta1a/", + "servicePath": "", "batchPath": "batch", "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, "alt": { "type": "string", - "description": "Data format for the response.", + "description": "Data format for response.", "default": "json", - "enum": [ - "json" - ], "enumDescriptions": [ - "Responses with Content-Type of application/json" + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" ], "location": "query" }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, "fields": { "type": "string", "description": "Selector specifying which fields to include in a partial response.", @@ -49,6 +63,12 @@ "description": "OAuth 2.0 token for the current user.", "location": "query" }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, "prettyPrint": { "type": "boolean", "description": "Returns response with indentations and line breaks.", @@ -57,12 +77,26 @@ }, "quotaUser": { "type": "string", - "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", "location": "query" }, - "userIp": { + "upload_protocol": { "type": "string", - "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], "location": "query" } }, @@ -79,52 +113,108 @@ } }, "schemas": { - "AcknowledgeRequest": { - "id": "AcknowledgeRequest", + "Topic": { + "id": "Topic", "type": "object", + "description": "A topic resource.", "properties": { - "ackId": { + "name": { + "type": "string", + "description": "Name of the topic." + } + } + }, + "PublishRequest": { + "id": "PublishRequest", + "type": "object", + "description": "Request for the Publish method.", + "properties": { + "topic": { + "type": "string", + "description": "The message in the request will be published on this topic." + }, + "message": { + "$ref": "PubsubMessage", + "description": "The message to publish." + } + } + }, + "PubsubMessage": { + "id": "PubsubMessage", + "type": "object", + "description": "A message data and its labels.", + "properties": { + "data": { + "type": "string", + "description": "The message payload.", + "format": "byte" + }, + "label": { "type": "array", + "description": "Optional list of labels for this message. Keys in this collection must be unique.", "items": { - "type": "string" + "$ref": "Label" } }, - "subscription": { - "type": "string" + "messageId": { + "type": "string", + "description": "ID of this message assigned by the server at publication time. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a PubsubMessage via a Pull call or a push delivery. It must not be populated by a publisher in a Publish call." + } + } + }, + "Label": { + "id": "Label", + "type": "object", + "description": "A key-value pair applied to a given object.", + "properties": { + "key": { + "type": "string", + "description": "The key of a label is a syntactically valid URL (as per RFC 1738) with the \"scheme\" and initial slashes omitted and with the additional restrictions noted below. Each key should be globally unique. The \"host\" portion is called the \"namespace\" and is not necessarily resolvable to a network endpoint. Instead, the namespace indicates what system or entity defines the semantics of the label. Namespaces do not restrict the set of objects to which a label may be associated. Keys are defined by the following grammar: key = hostname \"/\" kpath kpath = ksegment *[ \"/\" ksegment ] ksegment = alphadigit | *[ alphadigit | \"-\" | \"_\" | \".\" ] where \"hostname\" and \"alphadigit\" are defined as in RFC 1738. Example key: spanner.google.com/universe" + }, + "strValue": { + "type": "string", + "description": "A string value." + }, + "numValue": { + "type": "string", + "description": "An integer value.", + "format": "int64" } } }, "Empty": { "id": "Empty", - "type": "object" - }, - "Label": { - "id": "Label", "type": "object", + "description": "An empty message that you can re-use to avoid defining duplicated empty messages in your project. A typical example is to use it as argument or the return value of a service API. For instance: service Foo { rpc Bar (proto2.Empty) returns (proto2.Empty) { }; }; BEGIN GOOGLE-INTERNAL The difference between this one and net/rpc/empty-message.proto is that 1) The generated message here is in proto2 C++ API. 2) The proto2.Empty has minimum dependencies (no message_set or net/rpc dependencies) END GOOGLE-INTERNAL" + }, + "PublishBatchRequest": { + "id": "PublishBatchRequest", + "type": "object", + "description": "Request for the PublishBatch method.", "properties": { - "key": { - "type": "string" - }, - "numValue": { + "topic": { "type": "string", - "format": "int64" + "description": "The messages in the request will be published on this topic." }, - "strValue": { - "type": "string" + "messages": { + "type": "array", + "description": "The messages to publish.", + "items": { + "$ref": "PubsubMessage" + } } } }, - "ListSubscriptionsResponse": { - "id": "ListSubscriptionsResponse", + "PublishBatchResponse": { + "id": "PublishBatchResponse", "type": "object", + "description": "Response for the PublishBatch method.", "properties": { - "nextPageToken": { - "type": "string" - }, - "subscription": { + "messageIds": { "type": "array", + "description": "The server-assigned ID of each published message, in the same order as the messages in the request. IDs are guaranteed to be unique within the topic.", "items": { - "$ref": "Subscription" + "type": "string" } } } @@ -132,392 +222,228 @@ "ListTopicsResponse": { "id": "ListTopicsResponse", "type": "object", + "description": "Response for the ListTopics method.", "properties": { - "nextPageToken": { - "type": "string" - }, "topic": { "type": "array", + "description": "The resulting topics.", "items": { "$ref": "Topic" } + }, + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there are more topics that match the request, and this value should be passed to the next ListTopicsRequest to continue." + } + } + }, + "Subscription": { + "id": "Subscription", + "type": "object", + "description": "A subscription resource.", + "properties": { + "name": { + "type": "string", + "description": "Name of the subscription." + }, + "topic": { + "type": "string", + "description": "The name of the topic from which this subscription is receiving messages." + }, + "pushConfig": { + "$ref": "PushConfig", + "description": "If push delivery is used with this subscription, this field is used to configure it." + }, + "ackDeadlineSeconds": { + "type": "integer", + "description": "For either push or pull delivery, the value is the maximum time after a subscriber receives a message before the subscriber should acknowledge or Nack the message. If the Ack deadline for a message passes without an Ack or a Nack, the Pub/Sub system will eventually redeliver the message. If a subscriber acknowledges after the deadline, the Pub/Sub system may accept the Ack, but it is possible that the message has been already delivered again. Multiple Acks to the message are allowed and will succeed. For push delivery, this value is used to set the request timeout for the call to the push endpoint. For pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for each message using its corresponding ack_id with ModifyAckDeadline. While a message is outstanding (i.e. it has been delivered to a pull subscriber and the subscriber has not yet Acked or Nacked), the Pub/Sub system will not deliver that message to another pull subscriber (on a best-effort basis).", + "format": "int32" + } + } + }, + "PushConfig": { + "id": "PushConfig", + "type": "object", + "description": "Configuration for a push delivery endpoint.", + "properties": { + "pushEndpoint": { + "type": "string", + "description": "A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use \"https://example.com/push\"." + } + } + }, + "ListSubscriptionsResponse": { + "id": "ListSubscriptionsResponse", + "type": "object", + "description": "Response for the ListSubscriptions method.", + "properties": { + "subscription": { + "type": "array", + "description": "The subscriptions that match the request.", + "items": { + "$ref": "Subscription" + } + }, + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there are more subscriptions that match the request and this value should be passed to the next ListSubscriptionsRequest to continue." + } + } + }, + "ModifyPushConfigRequest": { + "id": "ModifyPushConfigRequest", + "type": "object", + "description": "Request for the ModifyPushConfig method.", + "properties": { + "subscription": { + "type": "string", + "description": "The name of the subscription." + }, + "pushConfig": { + "$ref": "PushConfig", + "description": "An empty push_config indicates that the Pub/Sub system should pause pushing messages from the given subscription." + } + } + }, + "PullRequest": { + "id": "PullRequest", + "type": "object", + "description": "Request for the Pull method.", + "properties": { + "subscription": { + "type": "string", + "description": "The subscription from which a message should be pulled." + }, + "returnImmediately": { + "type": "boolean", + "description": "If this is specified as true the system will respond immediately even if it is not able to return a message in the Pull response. Otherwise the system is allowed to wait until at least one message is available rather than returning FAILED_PRECONDITION. The client may cancel the request if it does not wish to wait any longer for the response." + } + } + }, + "PullResponse": { + "id": "PullResponse", + "type": "object", + "description": "Either a PubsubMessage or a truncation event. One of these two must be populated.", + "properties": { + "ackId": { + "type": "string", + "description": "This ID must be used to acknowledge the received event or message." + }, + "pubsubEvent": { + "$ref": "PubsubEvent", + "description": "A pubsub message or truncation event." + } + } + }, + "PubsubEvent": { + "id": "PubsubEvent", + "type": "object", + "description": "An event indicating a received message or truncation event.", + "properties": { + "subscription": { + "type": "string", + "description": "The subscription that received the event." + }, + "message": { + "$ref": "PubsubMessage", + "description": "A received message." + }, + "truncated": { + "type": "boolean", + "description": "Indicates that this subscription has been truncated." + }, + "deleted": { + "type": "boolean", + "description": "Indicates that this subscription has been deleted. (Note that pull subscribers will always receive NOT_FOUND in response in their pull request on the subscription, rather than seeing this boolean.)" + } + } + }, + "PullBatchRequest": { + "id": "PullBatchRequest", + "type": "object", + "description": "Request for the PullBatch method.", + "properties": { + "subscription": { + "type": "string", + "description": "The subscription from which messages should be pulled." + }, + "returnImmediately": { + "type": "boolean", + "description": "If this is specified as true the system will respond immediately even if it is not able to return a message in the Pull response. Otherwise the system is allowed to wait until at least one message is available rather than returning no messages. The client may cancel the request if it does not wish to wait any longer for the response." + }, + "maxEvents": { + "type": "integer", + "description": "The maximum number of PubsubEvents returned for this request. The Pub/Sub system may return fewer than the number of events specified.", + "format": "int32" + } + } + }, + "PullBatchResponse": { + "id": "PullBatchResponse", + "type": "object", + "description": "Response for the PullBatch method.", + "properties": { + "pullResponses": { + "type": "array", + "description": "Received Pub/Sub messages or status events. The Pub/Sub system will return zero messages if there are no more messages available in the backlog. The Pub/Sub system may return fewer than the max_events requested even if there are more messages available in the backlog.", + "items": { + "$ref": "PullResponse" + } } } }, "ModifyAckDeadlineRequest": { "id": "ModifyAckDeadlineRequest", "type": "object", + "description": "Request for the ModifyAckDeadline method.", "properties": { - "ackDeadlineSeconds": { - "type": "integer", - "format": "int32" + "subscription": { + "type": "string", + "description": "Next Index: 5 The name of the subscription from which messages are being pulled." }, "ackId": { - "type": "string" + "type": "string", + "description": "The acknowledgment ID. Either this or ack_ids must be populated, not both." }, - "subscription": { - "type": "string" - } - } - }, - "ModifyPushConfigRequest": { - "id": "ModifyPushConfigRequest", - "type": "object", - "properties": { - "pushConfig": { - "$ref": "PushConfig" - }, - "subscription": { - "type": "string" - } - } - }, - "PublishBatchRequest": { - "id": "PublishBatchRequest", - "type": "object", - "properties": { - "messages": { + "ackIds": { "type": "array", + "description": "List of acknowledgment IDs. Either this field or ack_id should be populated, not both. TODO(handrei): mark the above field deprecated once it's not used internally.", "items": { - "$ref": "PubsubMessage" + "type": "string" } }, - "topic": { - "type": "string" + "ackDeadlineSeconds": { + "type": "integer", + "description": "The new ack deadline with respect to the time this request was sent to the Pub/Sub system. Must be \u003e= 0. For example, if the value is 10, the new ack deadline will expire 10 seconds after the ModifyAckDeadline call was made. Specifying zero may immediately make the message available for another pull request.", + "format": "int32" } } }, - "PublishBatchResponse": { - "id": "PublishBatchResponse", + "AcknowledgeRequest": { + "id": "AcknowledgeRequest", "type": "object", + "description": "Request for the Acknowledge method.", "properties": { - "messageIds": { + "subscription": { + "type": "string", + "description": "The subscription whose message is being acknowledged." + }, + "ackId": { "type": "array", + "description": "The acknowledgment ID for the message being acknowledged. This was returned by the Pub/Sub system in the Pull response.", "items": { "type": "string" } } } - }, - "PublishRequest": { - "id": "PublishRequest", - "type": "object", - "properties": { - "message": { - "$ref": "PubsubMessage" - }, - "topic": { - "type": "string" - } - } - }, - "PubsubEvent": { - "id": "PubsubEvent", - "type": "object", - "properties": { - "deleted": { - "type": "boolean" - }, - "message": { - "$ref": "PubsubMessage" - }, - "subscription": { - "type": "string" - }, - "truncated": { - "type": "boolean" - } - } - }, - "PubsubMessage": { - "id": "PubsubMessage", - "type": "object", - "properties": { - "data": { - "type": "string", - "format": "byte" - }, - "label": { - "type": "array", - "items": { - "$ref": "Label" - } - }, - "messageId": { - "type": "string" - } - } - }, - "PullBatchRequest": { - "id": "PullBatchRequest", - "type": "object", - "properties": { - "maxEvents": { - "type": "integer", - "format": "int32" - }, - "returnImmediately": { - "type": "boolean" - }, - "subscription": { - "type": "string" - } - } - }, - "PullBatchResponse": { - "id": "PullBatchResponse", - "type": "object", - "properties": { - "pullResponses": { - "type": "array", - "items": { - "$ref": "PullResponse" - } - } - } - }, - "PullRequest": { - "id": "PullRequest", - "type": "object", - "properties": { - "returnImmediately": { - "type": "boolean" - }, - "subscription": { - "type": "string" - } - } - }, - "PullResponse": { - "id": "PullResponse", - "type": "object", - "properties": { - "ackId": { - "type": "string" - }, - "pubsubEvent": { - "$ref": "PubsubEvent" - } - } - }, - "PushConfig": { - "id": "PushConfig", - "type": "object", - "properties": { - "pushEndpoint": { - "type": "string" - } - } - }, - "Subscription": { - "id": "Subscription", - "type": "object", - "properties": { - "ackDeadlineSeconds": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - }, - "pushConfig": { - "$ref": "PushConfig" - }, - "topic": { - "type": "string" - } - } - }, - "Topic": { - "id": "Topic", - "type": "object", - "properties": { - "name": { - "type": "string" - } - } } }, "resources": { - "subscriptions": { - "methods": { - "acknowledge": { - "id": "pubsub.subscriptions.acknowledge", - "path": "subscriptions/acknowledge", - "httpMethod": "POST", - "description": "Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull.", - "request": { - "$ref": "AcknowledgeRequest" - }, - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "create": { - "id": "pubsub.subscriptions.create", - "path": "subscriptions", - "httpMethod": "POST", - "description": "Creates a subscription on a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.", - "request": { - "$ref": "Subscription" - }, - "response": { - "$ref": "Subscription" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "delete": { - "id": "pubsub.subscriptions.delete", - "path": "subscriptions/{+subscription}", - "httpMethod": "DELETE", - "description": "Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND.", - "parameters": { - "subscription": { - "type": "string", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "subscription" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "get": { - "id": "pubsub.subscriptions.get", - "path": "subscriptions/{+subscription}", - "httpMethod": "GET", - "description": "Gets the configuration details of a subscription.", - "parameters": { - "subscription": { - "type": "string", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "subscription" - ], - "response": { - "$ref": "Subscription" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "list": { - "id": "pubsub.subscriptions.list", - "path": "subscriptions", - "httpMethod": "GET", - "description": "Lists matching subscriptions.", - "parameters": { - "maxResults": { - "type": "integer", - "format": "int32", - "location": "query" - }, - "pageToken": { - "type": "string", - "location": "query" - }, - "query": { - "type": "string", - "location": "query" - } - }, - "response": { - "$ref": "ListSubscriptionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "modifyAckDeadline": { - "id": "pubsub.subscriptions.modifyAckDeadline", - "path": "subscriptions/modifyAckDeadline", - "httpMethod": "POST", - "description": "Modifies the Ack deadline for a message received from a pull request.", - "request": { - "$ref": "ModifyAckDeadlineRequest" - }, - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "modifyPushConfig": { - "id": "pubsub.subscriptions.modifyPushConfig", - "path": "subscriptions/modifyPushConfig", - "httpMethod": "POST", - "description": "Modifies the 74code76PushConfig74/code76 for a specified subscription. This method can be used to suspend the flow of messages to an endpoint by clearing the 74code76PushConfig74/code76 field in the request. Messages will be accumulated for delivery even if no push configuration is defined or while the configuration is modified.", - "request": { - "$ref": "ModifyPushConfigRequest" - }, - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "pull": { - "id": "pubsub.subscriptions.pull", - "path": "subscriptions/pull", - "httpMethod": "POST", - "description": "Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load).", - "request": { - "$ref": "PullRequest" - }, - "response": { - "$ref": "PullResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "pullBatch": { - "id": "pubsub.subscriptions.pullBatch", - "path": "subscriptions/pullBatch", - "httpMethod": "POST", - "description": "Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests outstanding for the given subscription.", - "request": { - "$ref": "PullBatchRequest" - }, - "response": { - "$ref": "PullBatchResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - } - } - }, "topics": { "methods": { "create": { "id": "pubsub.topics.create", - "path": "topics", + "path": "v1beta1a/topics", "httpMethod": "POST", "description": "Creates the given topic with the given name.", "request": { @@ -531,21 +457,14 @@ "https://www.googleapis.com/auth/pubsub" ] }, - "delete": { - "id": "pubsub.topics.delete", - "path": "topics/{+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.", - "parameters": { - "topic": { - "type": "string", - "required": true, - "location": "path" - } + "publish": { + "id": "pubsub.topics.publish", + "path": "v1beta1a/topics/publish", + "httpMethod": "POST", + "description": "Adds a message to the topic. Returns NOT_FOUND if the topic does not exist.", + "request": { + "$ref": "PublishRequest" }, - "parameterOrder": [ - "topic" - ], "response": { "$ref": "Empty" }, @@ -554,15 +473,33 @@ "https://www.googleapis.com/auth/pubsub" ] }, + "publishBatch": { + "id": "pubsub.topics.publishBatch", + "path": "v1beta1a/topics/publishBatch", + "httpMethod": "POST", + "description": "Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.", + "request": { + "$ref": "PublishBatchRequest" + }, + "response": { + "$ref": "PublishBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, "get": { "id": "pubsub.topics.get", - "path": "topics/{+topic}", + "path": "v1beta1a/topics/{+topic}", "httpMethod": "GET", "description": "Gets the configuration of a topic. Since the topic only has the name attribute, this method is only useful to check the existence of a topic. If other attributes are added in the future, they will be returned here.", "parameters": { "topic": { "type": "string", + "description": "The name of the topic to get.", "required": true, + "pattern": "^.*$", "location": "path" } }, @@ -579,21 +516,24 @@ }, "list": { "id": "pubsub.topics.list", - "path": "topics", + "path": "v1beta1a/topics", "httpMethod": "GET", "description": "Lists matching topics.", "parameters": { + "query": { + "type": "string", + "description": "A valid label query expression.", + "location": "query" + }, "maxResults": { "type": "integer", + "description": "Maximum number of topics to return.", "format": "int32", "location": "query" }, "pageToken": { "type": "string", - "location": "query" - }, - "query": { - "type": "string", + "description": "The value obtained in the last ListTopicsResponse for continuation.", "location": "query" } }, @@ -605,13 +545,139 @@ "https://www.googleapis.com/auth/pubsub" ] }, - "publish": { - "id": "pubsub.topics.publish", - "path": "topics/publish", + "delete": { + "id": "pubsub.topics.delete", + "path": "v1beta1a/topics/{+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.", + "parameters": { + "topic": { + "type": "string", + "description": "Name of the topic to delete.", + "required": true, + "pattern": "^.*$", + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + } + } + }, + "subscriptions": { + "methods": { + "create": { + "id": "pubsub.subscriptions.create", + "path": "v1beta1a/subscriptions", "httpMethod": "POST", - "description": "Adds a message to the topic. Returns NOT_FOUND if the topic does not exist.", + "description": "Creates a subscription on a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.", "request": { - "$ref": "PublishRequest" + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "get": { + "id": "pubsub.subscriptions.get", + "path": "v1beta1a/subscriptions/{+subscription}", + "httpMethod": "GET", + "description": "Gets the configuration details of a subscription.", + "parameters": { + "subscription": { + "type": "string", + "description": "The name of the subscription to get.", + "required": true, + "pattern": "^.*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "list": { + "id": "pubsub.subscriptions.list", + "path": "v1beta1a/subscriptions", + "httpMethod": "GET", + "description": "Lists matching subscriptions.", + "parameters": { + "query": { + "type": "string", + "description": "A valid label query expression.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of subscriptions to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value obtained in the last ListSubscriptionsResponse for continuation.", + "location": "query" + } + }, + "response": { + "$ref": "ListSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "delete": { + "id": "pubsub.subscriptions.delete", + "path": "v1beta1a/subscriptions/{+subscription}", + "httpMethod": "DELETE", + "description": "Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND.", + "parameters": { + "subscription": { + "type": "string", + "description": "The subscription to delete.", + "required": true, + "pattern": "^.*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "modifyPushConfig": { + "id": "pubsub.subscriptions.modifyPushConfig", + "path": "v1beta1a/subscriptions/modifyPushConfig", + "httpMethod": "POST", + "description": "Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an endpoint by clearing the PushConfig field in the request. Messages will be accumulated for delivery even if no push configuration is defined or while the configuration is modified.", + "request": { + "$ref": "ModifyPushConfigRequest" }, "response": { "$ref": "Empty" @@ -621,16 +687,64 @@ "https://www.googleapis.com/auth/pubsub" ] }, - "publishBatch": { - "id": "pubsub.topics.publishBatch", - "path": "topics/publishBatch", + "pull": { + "id": "pubsub.subscriptions.pull", + "path": "v1beta1a/subscriptions/pull", "httpMethod": "POST", - "description": "Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.", + "description": "Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load).", "request": { - "$ref": "PublishBatchRequest" + "$ref": "PullRequest" }, "response": { - "$ref": "PublishBatchResponse" + "$ref": "PullResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "pullBatch": { + "id": "pubsub.subscriptions.pullBatch", + "path": "v1beta1a/subscriptions/pullBatch", + "httpMethod": "POST", + "description": "Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests outstanding for the given subscription.", + "request": { + "$ref": "PullBatchRequest" + }, + "response": { + "$ref": "PullBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "modifyAckDeadline": { + "id": "pubsub.subscriptions.modifyAckDeadline", + "path": "v1beta1a/subscriptions/modifyAckDeadline", + "httpMethod": "POST", + "description": "Modifies the Ack deadline for a message received from a pull request.", + "request": { + "$ref": "ModifyAckDeadlineRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "acknowledge": { + "id": "pubsub.subscriptions.acknowledge", + "path": "v1beta1a/subscriptions/acknowledge", + "httpMethod": "POST", + "description": "Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull.", + "request": { + "$ref": "AcknowledgeRequest" + }, + "response": { + "$ref": "Empty" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", diff --git a/etc/api/pubsub/v1beta2/pubsub-api.json b/etc/api/pubsub/v1beta2/pubsub-api.json index e0aa7cffa5..90b7262182 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/k747AQVNKzUoa08QT-Z1GxOMZC0\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/VK6LFY090HaPGVrEqnv6Rpqzlmo\"", "discoveryVersion": "v1", "id": "pubsub:v1beta2", "name": "pubsub", "version": "v1beta2", - "revision": "20150326", + "revision": "20150427", "title": "Google Cloud Pub/Sub API", "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", "ownerDomain": "google.com", @@ -14,26 +14,40 @@ "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" }, - "documentationLink": "", + "documentationLink": "https://cloud.google.com/pubsub/docs", "protocol": "rest", - "baseUrl": "https://pubsub.googleapis.com/v1beta2/", - "basePath": "/v1beta2/", + "baseUrl": "https://pubsub.googleapis.com/", + "basePath": "", "rootUrl": "https://pubsub.googleapis.com/", - "servicePath": "v1beta2/", + "servicePath": "", "batchPath": "batch", "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, "alt": { "type": "string", - "description": "Data format for the response.", + "description": "Data format for response.", "default": "json", - "enum": [ - "json" - ], "enumDescriptions": [ - "Responses with Content-Type of application/json" + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" ], "location": "query" }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, "fields": { "type": "string", "description": "Selector specifying which fields to include in a partial response.", @@ -49,6 +63,12 @@ "description": "OAuth 2.0 token for the current user.", "location": "query" }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, "prettyPrint": { "type": "boolean", "description": "Returns response with indentations and line breaks.", @@ -57,12 +77,26 @@ }, "quotaUser": { "type": "string", - "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", "location": "query" }, - "userIp": { + "upload_protocol": { "type": "string", - "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], "location": "query" } }, @@ -79,46 +113,305 @@ } }, "schemas": { - "AcknowledgeRequest": { - "id": "AcknowledgeRequest", + "SetIamPolicyRequest": { + "id": "SetIamPolicyRequest", "type": "object", + "description": "Request message for `SetIamPolicy` method.", "properties": { - "ackIds": { + "policy": { + "$ref": "Policy", + "description": "REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them." + } + } + }, + "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\"] } ] } ```", + "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.", + "format": "int32" + }, + "bindings": { "type": "array", + "description": "It is an error to specify multiple bindings for the same role. It is an error to specify a binding with no members.", + "items": { + "$ref": "Binding" + } + }, + "rules": { + "type": "array", + "items": { + "$ref": "Rule" + } + }, + "etag": { + "type": "string", + "description": "Can be used to perform a read-modify-write.", + "format": "byte" + } + } + }, + "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.", + "properties": { + "role": { + "type": "string", + "description": "The name of the role to which the members should be bound. Examples: \"roles/viewer\", \"roles/editor\", \"roles/owner\". Required" + }, + "members": { + "type": "array", + "description": "Format of member entries: 1. allUsers Matches any requesting principal (users, service accounts or anonymous). 2. allAuthenticatedUsers Matches any requesting authenticated principal (users or service accounts). 3. user:{emailid} A google user account using an email address. For example alice@gmail.com, joe@example.com 4. serviceAccount:{emailid} An service account email. 5. group:{emailid} A google group with an email address. For example auth-ti-cloud@google.com 6. domain:{domain} A Google Apps domain name. For example google.com, example.com", "items": { "type": "string" } } } }, - "Empty": { - "id": "Empty", - "type": "object" - }, - "ListSubscriptionsResponse": { - "id": "ListSubscriptionsResponse", + "Rule": { + "id": "Rule", "type": "object", + "description": "A rule to be applied in a Policy.", "properties": { - "nextPageToken": { - "type": "string" + "description": { + "type": "string", + "description": "Human-readable description of the rule." }, - "subscriptions": { + "permissions": { "type": "array", + "description": "A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.", "items": { - "$ref": "Subscription" + "type": "string" + } + }, + "action": { + "type": "string", + "description": "Required", + "enum": [ + "NO_ACTION", + "ALLOW", + "ALLOW_WITH_LOG", + "DENY", + "DENY_WITH_LOG", + "LOG" + ] + }, + "in": { + "type": "array", + "description": "The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in this set of entries.", + "items": { + "type": "string" + } + }, + "notIn": { + "type": "array", + "description": "The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is not in this set of entries. The formation for in and not_in entries is the same as members in a Binding above.", + "items": { + "type": "string" + } + }, + "conditions": { + "type": "array", + "description": "Additional restrictions that must be met", + "items": { + "$ref": "Condition" + } + }, + "logConfig": { + "type": "array", + "description": "The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.", + "items": { + "$ref": "LogConfig" } } } }, - "ListTopicSubscriptionsResponse": { - "id": "ListTopicSubscriptionsResponse", + "Condition": { + "id": "Condition", "type": "object", + "description": "A condition to be met.", "properties": { - "nextPageToken": { - "type": "string" + "iam": { + "type": "string", + "description": "Trusted attributes supplied by the IAM system.", + "enum": [ + "NO_ATTR", + "AUTHORITY", + "ATTRIBUTION" + ] }, - "subscriptions": { + "sys": { + "type": "string", + "description": "Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.", + "enum": [ + "NO_ATTR", + "REGION", + "SERVICE", + "NAME", + "IP" + ] + }, + "svc": { + "type": "string", + "description": "Trusted attributes discharged by the service." + }, + "op": { + "type": "string", + "description": "An operator to apply the subject with.", + "enum": [ + "NO_OP", + "EQUALS", + "NOT_EQUALS", + "IN", + "NOT_IN", + "DISCHARGED" + ] + }, + "value": { + "type": "string", + "description": "The object of the condition. Exactly one of these must be set." + }, + "values": { "type": "array", + "description": "The objects of the condition. This is mutually exclusive with 'value'.", + "items": { + "type": "string" + } + } + } + }, + "LogConfig": { + "id": "LogConfig", + "type": "object", + "description": "Specifies what kind of log the caller must write Increment a streamz counter with the specified metric and field names. Metric names should start with a '/', generally be lowercase-only, and end in \"_count\". Field names should not contain an initial slash. The actual exported metric names will have \"/iam/policy\" prepended. Field names correspond to IAM request parameters and field values are their respective values. At present only \"iam_principal\", corresponding to IAMContext.principal, is supported. Examples: counter { metric: \"/debug_access_count\" field: \"iam_principal\" } ==\u003e increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]} At this time we do not support: * multiple field names (though this may be supported in the future) * decrementing the counter * incrementing it by anything other than 1", + "properties": { + "counter": { + "$ref": "CounterOptions", + "description": "Counter options." + }, + "dataAccess": { + "$ref": "DataAccessOptions", + "description": "Data access options." + }, + "cloudAudit": { + "$ref": "CloudAuditOptions", + "description": "Cloud audit options." + } + } + }, + "CounterOptions": { + "id": "CounterOptions", + "type": "object", + "description": "Options for counters", + "properties": { + "metric": { + "type": "string", + "description": "The metric to update." + }, + "field": { + "type": "string", + "description": "The field value to attribute." + } + } + }, + "DataAccessOptions": { + "id": "DataAccessOptions", + "type": "object", + "description": "Write a Data Access (Gin) log" + }, + "CloudAuditOptions": { + "id": "CloudAuditOptions", + "type": "object", + "description": "Write a Cloud Audit log" + }, + "TestIamPermissionsRequest": { + "id": "TestIamPermissionsRequest", + "type": "object", + "description": "Request message for `TestIamPermissions` method.", + "properties": { + "permissions": { + "type": "array", + "description": "The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.", + "items": { + "type": "string" + } + } + } + }, + "TestIamPermissionsResponse": { + "id": "TestIamPermissionsResponse", + "type": "object", + "description": "Response message for `TestIamPermissions` method.", + "properties": { + "permissions": { + "type": "array", + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is allowed.", + "items": { + "type": "string" + } + } + } + }, + "Topic": { + "id": "Topic", + "type": "object", + "description": "A topic resource.", + "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\"." + } + } + }, + "PublishRequest": { + "id": "PublishRequest", + "type": "object", + "description": "Request for the Publish method.", + "properties": { + "messages": { + "type": "array", + "description": "The messages to publish.", + "items": { + "$ref": "PubsubMessage" + } + } + } + }, + "PubsubMessage": { + "id": "PubsubMessage", + "type": "object", + "description": "A message data and its attributes.", + "properties": { + "data": { + "type": "string", + "description": "The message payload. For JSON requests, the value of this field must be base64-encoded.", + "format": "byte" + }, + "attributes": { + "type": "object", + "description": "Optional attributes for this message.", + "additionalProperties": { + "type": "string" + } + }, + "messageId": { + "type": "string", + "description": "ID of this message assigned by the server at publication time. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a PubsubMessage via a Pull call or a push delivery. It must not be populated by a publisher in a Publish call." + } + } + }, + "PublishResponse": { + "id": "PublishResponse", + "type": "object", + "description": "Response for the Publish method.", + "properties": { + "messageIds": { + "type": "array", + "description": "The server-assigned ID of each published message, in the same order as the messages in the request. IDs are guaranteed to be unique within the topic.", "items": { "type": "string" } @@ -128,160 +421,194 @@ "ListTopicsResponse": { "id": "ListTopicsResponse", "type": "object", + "description": "Response for the ListTopics method.", "properties": { - "nextPageToken": { - "type": "string" - }, "topics": { "type": "array", + "description": "The resulting topics.", "items": { "$ref": "Topic" } + }, + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there may be more topics that match the request; this value should be passed in a new ListTopicsRequest." } } }, - "ModifyAckDeadlineRequest": { - "id": "ModifyAckDeadlineRequest", + "ListTopicSubscriptionsResponse": { + "id": "ListTopicSubscriptionsResponse", "type": "object", + "description": "Response for the ListTopicSubscriptions method.", "properties": { + "subscriptions": { + "type": "array", + "description": "The names of the subscriptions that match the request.", + "items": { + "type": "string" + } + }, + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there may be more subscriptions that match the request; this value should be passed in a new ListTopicSubscriptionsRequest to get more subscriptions." + } + } + }, + "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); }" + }, + "Subscription": { + "id": "Subscription", + "type": "object", + "description": "A subscription resource.", + "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\"." + }, + "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." + }, + "pushConfig": { + "$ref": "PushConfig", + "description": "If push delivery is used with this subscription, this field is used to configure it. An empty pushConfig signifies that the subscriber will pull and ack messages using API methods." + }, "ackDeadlineSeconds": { "type": "integer", + "description": "This value is the maximum time after a subscriber receives a message before the subscriber should acknowledge the message. After message delivery but before the ack deadline expires and before the message is acknowledged, it is an outstanding message and will not be delivered again during that time (on a best-effort basis). For pull delivery this value is used as the initial value for the ack deadline. It may be overridden for each message using its corresponding ack_id by calling ModifyAckDeadline. For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. If this parameter is not set, the default value of 60 seconds is used.", "format": "int32" - }, - "ackId": { - "type": "string" - } - } - }, - "ModifyPushConfigRequest": { - "id": "ModifyPushConfigRequest", - "type": "object", - "properties": { - "pushConfig": { - "$ref": "PushConfig" - } - } - }, - "PublishRequest": { - "id": "PublishRequest", - "type": "object", - "properties": { - "messages": { - "type": "array", - "items": { - "$ref": "PubsubMessage" - } - } - } - }, - "PublishResponse": { - "id": "PublishResponse", - "type": "object", - "properties": { - "messageIds": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "PubsubMessage": { - "id": "PubsubMessage", - "type": "object", - "properties": { - "attributes": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "data": { - "type": "string", - "format": "byte" - }, - "messageId": { - "type": "string" - } - } - }, - "PullRequest": { - "id": "PullRequest", - "type": "object", - "properties": { - "maxMessages": { - "type": "integer", - "format": "int32" - }, - "returnImmediately": { - "type": "boolean" - } - } - }, - "PullResponse": { - "id": "PullResponse", - "type": "object", - "properties": { - "receivedMessages": { - "type": "array", - "items": { - "$ref": "ReceivedMessage" - } } } }, "PushConfig": { "id": "PushConfig", "type": "object", + "description": "Configuration for a push delivery endpoint.", "properties": { + "pushEndpoint": { + "type": "string", + "description": "A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use \"https://example.com/push\"." + }, "attributes": { "type": "object", + "description": "Endpoint configuration attributes. Every endpoint has a set of API supported attributes that can be used to control different aspects of the message delivery. The currently supported attribute is `x-goog-version`, which you can use to change the format of the push message. This attribute indicates the version of the data expected by the endpoint. This controls the shape of the envelope (i.e. its fields and metadata). The endpoint version is based on the version of the Pub/Sub API. If not present during the CreateSubscription call, it will default to the version of the API used to make such call. If not present during a ModifyPushConfig call, its value will not be changed. GetSubscription calls will always return a valid version, even if the subscription was created without this attribute. The possible values for this attribute are: * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.", "additionalProperties": { "type": "string" } + } + } + }, + "ListSubscriptionsResponse": { + "id": "ListSubscriptionsResponse", + "type": "object", + "description": "Response for the ListSubscriptions method.", + "properties": { + "subscriptions": { + "type": "array", + "description": "The subscriptions that match the request.", + "items": { + "$ref": "Subscription" + } }, - "pushEndpoint": { - "type": "string" + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there may be more subscriptions that match the request; this value should be passed in a new ListSubscriptionsRequest to get more subscriptions." + } + } + }, + "ModifyAckDeadlineRequest": { + "id": "ModifyAckDeadlineRequest", + "type": "object", + "description": "Request for the ModifyAckDeadline method.", + "properties": { + "ackId": { + "type": "string", + "description": "The acknowledgment ID." + }, + "ackIds": { + "type": "array", + "description": "List of acknowledgment IDs.", + "items": { + "type": "string" + } + }, + "ackDeadlineSeconds": { + "type": "integer", + "description": "The new ack deadline with respect to the time this request was sent to the Pub/Sub system. Must be \u003e= 0. For example, if the value is 10, the new ack deadline will expire 10 seconds after the ModifyAckDeadline call was made. Specifying zero may immediately make the message available for another pull request.", + "format": "int32" + } + } + }, + "AcknowledgeRequest": { + "id": "AcknowledgeRequest", + "type": "object", + "description": "Request for the Acknowledge method.", + "properties": { + "ackIds": { + "type": "array", + "description": "The acknowledgment ID for the messages being acknowledged that was returned by the Pub/Sub system in the Pull response. Must not be empty.", + "items": { + "type": "string" + } + } + } + }, + "PullRequest": { + "id": "PullRequest", + "type": "object", + "description": "Request for the Pull method.", + "properties": { + "returnImmediately": { + "type": "boolean", + "description": "If this is specified as true the system will respond immediately even if it is not able to return a message in the Pull response. Otherwise the system is allowed to wait until at least one message is available rather than returning no messages. The client may cancel the request if it does not wish to wait any longer for the response." + }, + "maxMessages": { + "type": "integer", + "description": "The maximum number of messages returned for this request. The Pub/Sub system may return fewer than the number specified.", + "format": "int32" + } + } + }, + "PullResponse": { + "id": "PullResponse", + "type": "object", + "description": "Response for the Pull method.", + "properties": { + "receivedMessages": { + "type": "array", + "description": "Received Pub/Sub messages. The Pub/Sub system will return zero messages if there are no more available in the backlog. The Pub/Sub system may return fewer than the maxMessages requested even if there are more messages available in the backlog.", + "items": { + "$ref": "ReceivedMessage" + } } } }, "ReceivedMessage": { "id": "ReceivedMessage", "type": "object", + "description": "A message and its corresponding acknowledgment ID.", "properties": { "ackId": { - "type": "string" + "type": "string", + "description": "This ID can be used to acknowledge the received message." }, "message": { - "$ref": "PubsubMessage" + "$ref": "PubsubMessage", + "description": "The message." } } }, - "Subscription": { - "id": "Subscription", + "ModifyPushConfigRequest": { + "id": "ModifyPushConfigRequest", "type": "object", + "description": "Request for the ModifyPushConfig method.", "properties": { - "ackDeadlineSeconds": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - }, "pushConfig": { - "$ref": "PushConfig" - }, - "topic": { - "type": "string" - } - } - }, - "Topic": { - "id": "Topic", - "type": "object", - "properties": { - "name": { - "type": "string" + "$ref": "PushConfig", + "description": "The push configuration for future deliveries. An empty pushConfig indicates that the Pub/Sub system should stop pushing messages from the given subscription and allow messages to be pulled and acknowledged - effectively pausing the subscription if Pull is not called." } } } @@ -289,26 +616,223 @@ "resources": { "projects": { "resources": { - "subscriptions": { + "topics": { "methods": { - "acknowledge": { - "id": "pubsub.projects.subscriptions.acknowledge", - "path": "{+subscription}:acknowledge", + "setIamPolicy": { + "id": "pubsub.projects.topics.setIamPolicy", + "path": "v1beta2/{+resource}:setIamPolicy", "httpMethod": "POST", - "description": "Acknowledges the messages associated with the ack tokens in the AcknowledgeRequest. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", "parameters": { - "subscription": { + "resource": { "type": "string", + "description": "REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}.", "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", "location": "path" } }, "parameterOrder": [ - "subscription" + "resource" ], "request": { - "$ref": "AcknowledgeRequest" + "$ref": "SetIamPolicyRequest" }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "getIamPolicy": { + "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.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being requested. Usually some path like projects/{project}.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "testIamPermissions": { + "id": "pubsub.projects.topics.testIamPermissions", + "path": "v1beta2/{+resource}:testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified resource.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "create": { + "id": "pubsub.projects.topics.create", + "path": "v1beta2/{+name}", + "httpMethod": "PUT", + "description": "Creates the given topic with the given name.", + "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\".", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "Topic" + }, + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "publish": { + "id": "pubsub.projects.topics.publish", + "path": "v1beta2/{+topic}:publish", + "httpMethod": "POST", + "description": "Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.", + "parameters": { + "topic": { + "type": "string", + "description": "The messages in the request will be published on this topic.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], + "request": { + "$ref": "PublishRequest" + }, + "response": { + "$ref": "PublishResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "get": { + "id": "pubsub.projects.topics.get", + "path": "v1beta2/{+topic}", + "httpMethod": "GET", + "description": "Gets the configuration of a topic.", + "parameters": { + "topic": { + "type": "string", + "description": "The name of the topic to get.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "list": { + "id": "pubsub.projects.topics.list", + "path": "v1beta2/{+project}/topics", + "httpMethod": "GET", + "description": "Lists matching topics.", + "parameters": { + "project": { + "type": "string", + "description": "The name of the cloud project that topics belong to.", + "required": true, + "pattern": "^projects/[^/]*$", + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of topics to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value returned by the last ListTopicsResponse; indicates that this is a continuation of a prior ListTopics call, and that the system should return the next page of data.", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "ListTopicsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "delete": { + "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.", + "parameters": { + "topic": { + "type": "string", + "description": "Name of the topic to delete.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], "response": { "$ref": "Empty" }, @@ -316,16 +840,145 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" ] + } + }, + "resources": { + "subscriptions": { + "methods": { + "list": { + "id": "pubsub.projects.topics.subscriptions.list", + "path": "v1beta2/{+topic}/subscriptions", + "httpMethod": "GET", + "description": "Lists the name of the subscriptions for this topic.", + "parameters": { + "topic": { + "type": "string", + "description": "The name of the topic that subscriptions are attached to.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of subscription names to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value returned by the last ListTopicSubscriptionsResponse; indicates that this is a continuation of a prior ListTopicSubscriptions call, and that the system should return the next page of data.", + "location": "query" + } + }, + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "ListTopicSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + } + } + } + } + }, + "subscriptions": { + "methods": { + "setIamPolicy": { + "id": "pubsub.projects.subscriptions.setIamPolicy", + "path": "v1beta2/{+resource}:setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "getIamPolicy": { + "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.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being requested. Usually some path like projects/{project}.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "testIamPermissions": { + "id": "pubsub.projects.subscriptions.testIamPermissions", + "path": "v1beta2/{+resource}:testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified resource.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] }, "create": { "id": "pubsub.projects.subscriptions.create", - "path": "{+name}", + "path": "v1beta2/{+name}", "httpMethod": "PUT", "description": "Creates a subscription to a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.", "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\".", "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", "location": "path" } }, @@ -343,38 +996,17 @@ "https://www.googleapis.com/auth/pubsub" ] }, - "delete": { - "id": "pubsub.projects.subscriptions.delete", - "path": "{+subscription}", - "httpMethod": "DELETE", - "description": "Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription, or its topic unless the same topic is specified.", - "parameters": { - "subscription": { - "type": "string", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "subscription" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, "get": { "id": "pubsub.projects.subscriptions.get", - "path": "{+subscription}", + "path": "v1beta2/{+subscription}", "httpMethod": "GET", "description": "Gets the configuration details of a subscription.", "parameters": { "subscription": { "type": "string", + "description": "The name of the subscription to get.", "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", "location": "path" } }, @@ -391,23 +1023,27 @@ }, "list": { "id": "pubsub.projects.subscriptions.list", - "path": "{+project}/subscriptions", + "path": "v1beta2/{+project}/subscriptions", "httpMethod": "GET", "description": "Lists matching subscriptions.", "parameters": { + "project": { + "type": "string", + "description": "The name of the cloud project that subscriptions belong to.", + "required": true, + "pattern": "^projects/[^/]*$", + "location": "path" + }, "pageSize": { "type": "integer", + "description": "Maximum number of subscriptions to return.", "format": "int32", "location": "query" }, "pageToken": { "type": "string", + "description": "The value returned by the last ListSubscriptionsResponse; indicates that this is a continuation of a prior ListSubscriptions call, and that the system should return the next page of data.", "location": "query" - }, - "project": { - "type": "string", - "required": true, - "location": "path" } }, "parameterOrder": [ @@ -421,15 +1057,42 @@ "https://www.googleapis.com/auth/pubsub" ] }, + "delete": { + "id": "pubsub.projects.subscriptions.delete", + "path": "v1beta2/{+subscription}", + "httpMethod": "DELETE", + "description": "Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription, or its topic unless the same topic is specified.", + "parameters": { + "subscription": { + "type": "string", + "description": "The subscription to delete.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, "modifyAckDeadline": { "id": "pubsub.projects.subscriptions.modifyAckDeadline", - "path": "{+subscription}:modifyAckDeadline", + "path": "v1beta2/{+subscription}:modifyAckDeadline", "httpMethod": "POST", "description": "Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted.", "parameters": { "subscription": { "type": "string", + "description": "The name of the subscription.", "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", "location": "path" } }, @@ -447,15 +1110,17 @@ "https://www.googleapis.com/auth/pubsub" ] }, - "modifyPushConfig": { - "id": "pubsub.projects.subscriptions.modifyPushConfig", - "path": "{+subscription}:modifyPushConfig", + "acknowledge": { + "id": "pubsub.projects.subscriptions.acknowledge", + "path": "v1beta2/{+subscription}:acknowledge", "httpMethod": "POST", - "description": "Modifies the PushConfig for a specified subscription. This may be used to change a push subscription to a pull one (signified by an empty PushConfig) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the PushConfig.", + "description": "Acknowledges the messages associated with the ack tokens in the AcknowledgeRequest. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.", "parameters": { "subscription": { "type": "string", + "description": "The subscription whose message is being acknowledged.", "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", "location": "path" } }, @@ -463,7 +1128,7 @@ "subscription" ], "request": { - "$ref": "ModifyPushConfigRequest" + "$ref": "AcknowledgeRequest" }, "response": { "$ref": "Empty" @@ -475,13 +1140,15 @@ }, "pull": { "id": "pubsub.projects.subscriptions.pull", - "path": "{+subscription}:pull", + "path": "v1beta2/{+subscription}:pull", "httpMethod": "POST", "description": "Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The server may return UNAVAILABLE if there are too many concurrent pull requests pending for the given subscription.", "parameters": { "subscription": { "type": "string", + "description": "The subscription from which messages should be pulled.", "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", "location": "path" } }, @@ -498,52 +1165,27 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" ] - } - } - }, - "topics": { - "methods": { - "create": { - "id": "pubsub.projects.topics.create", - "path": "{+name}", - "httpMethod": "PUT", - "description": "Creates the given topic with the given name.", + }, + "modifyPushConfig": { + "id": "pubsub.projects.subscriptions.modifyPushConfig", + "path": "v1beta2/{+subscription}:modifyPushConfig", + "httpMethod": "POST", + "description": "Modifies the PushConfig for a specified subscription. This may be used to change a push subscription to a pull one (signified by an empty PushConfig) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the PushConfig.", "parameters": { - "name": { + "subscription": { "type": "string", + "description": "The name of the subscription.", "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", "location": "path" } }, "parameterOrder": [ - "name" + "subscription" ], "request": { - "$ref": "Topic" + "$ref": "ModifyPushConfigRequest" }, - "response": { - "$ref": "Topic" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "delete": { - "id": "pubsub.projects.topics.delete", - "path": "{+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.", - "parameters": { - "topic": { - "type": "string", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "topic" - ], "response": { "$ref": "Empty" }, @@ -551,125 +1193,6 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" ] - }, - "get": { - "id": "pubsub.projects.topics.get", - "path": "{+topic}", - "httpMethod": "GET", - "description": "Gets the configuration of a topic.", - "parameters": { - "topic": { - "type": "string", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "topic" - ], - "response": { - "$ref": "Topic" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "list": { - "id": "pubsub.projects.topics.list", - "path": "{+project}/topics", - "httpMethod": "GET", - "description": "Lists matching topics.", - "parameters": { - "pageSize": { - "type": "integer", - "format": "int32", - "location": "query" - }, - "pageToken": { - "type": "string", - "location": "query" - }, - "project": { - "type": "string", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "project" - ], - "response": { - "$ref": "ListTopicsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - }, - "publish": { - "id": "pubsub.projects.topics.publish", - "path": "{+topic}:publish", - "httpMethod": "POST", - "description": "Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.", - "parameters": { - "topic": { - "type": "string", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "topic" - ], - "request": { - "$ref": "PublishRequest" - }, - "response": { - "$ref": "PublishResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - } - }, - "resources": { - "subscriptions": { - "methods": { - "list": { - "id": "pubsub.projects.topics.subscriptions.list", - "path": "{+topic}/subscriptions", - "httpMethod": "GET", - "description": "Lists the name of the subscriptions for this topic.", - "parameters": { - "pageSize": { - "type": "integer", - "format": "int32", - "location": "query" - }, - "pageToken": { - "type": "string", - "location": "query" - }, - "topic": { - "type": "string", - "required": true, - "location": "path" - } - }, - "parameterOrder": [ - "topic" - ], - "response": { - "$ref": "ListTopicSubscriptionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - } - } } } } diff --git a/etc/api/replicapool/v1beta1/replicapool-api.json b/etc/api/replicapool/v1beta1/replicapool-api.json index 11cb5267a6..db51aec81d 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/HIX69NvjwRwyWABR5cX6q2kyt7Q\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/KkobOVPADtxrtyAljKA-ewKM_k8\"", "discoveryVersion": "v1", "id": "replicapool:v1beta1", "name": "replicapool", "version": "v1beta1", - "revision": "20150223", + "revision": "20150311", "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 2656af20a5..5a6d686487 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/GOQCR1ua2wlqdDdPhDp_nZFzTYw\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/H3mDQDqOlflMvFSf76ymqE9zKI8\"", "discoveryVersion": "v1", "id": "replicapool:v1beta2", "name": "replicapool", "version": "v1beta2", - "revision": "20150223", + "revision": "20150311", "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", @@ -90,6 +90,13 @@ "type": "object", "description": "An Instance Group Manager resource.", "properties": { + "autoHealingPolicies": { + "type": "array", + "description": "The autohealing policy for this managed instance group. You can specify only one value.", + "items": { + "$ref": "ReplicaPoolAutoHealingPolicy" + } + }, "baseInstanceName": { "type": "string", "description": "The base instance name to use for instances in this group. The value must be a valid RFC1035 name. Supported characters are lowercase letters, numbers, and hyphens (-). Instances are named by appending a hyphen and a random four-character string to the base instance name." @@ -471,6 +478,16 @@ "description": "Server defined URL for this resource (output only)." } } + }, + "ReplicaPoolAutoHealingPolicy": { + "id": "ReplicaPoolAutoHealingPolicy", + "type": "object", + "properties": { + "healthCheck": { + "type": "string", + "description": "The URL for the HealthCheck that signals autohealing." + } + } } }, "resources": { diff --git a/etc/api/reseller/v1/reseller-api.json b/etc/api/reseller/v1/reseller-api.json index 1c1e283cb2..ef4a1cd0bd 100644 --- a/etc/api/reseller/v1/reseller-api.json +++ b/etc/api/reseller/v1/reseller-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/30NaCo58E-23RA5z0DPpA4cSWB8\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/PnLFTM2U5cy1zCZ4AhS9GnZG4B0\"", "discoveryVersion": "v1", "id": "reseller:v1", "name": "reseller", "version": "v1", - "revision": "20141112", + "revision": "20150603", "title": "Enterprise Apps Reseller API", "description": "Lets you create and manage your customers and their subscriptions.", "ownerDomain": "google.com", @@ -314,6 +314,13 @@ "type": "string", "description": "The id of the subscription." }, + "suspensionReasons": { + "type": "array", + "description": "Suspension Reasons", + "items": { + "type": "string" + } + }, "transferInfo": { "type": "object", "description": "Transfer related information for the subscription.", diff --git a/etc/api/reseller/v1sandbox/reseller-api.json b/etc/api/reseller/v1sandbox/reseller-api.json index 93225726e1..921fa11864 100644 --- a/etc/api/reseller/v1sandbox/reseller-api.json +++ b/etc/api/reseller/v1sandbox/reseller-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/0hE-e3UCtEqliJBtSMk5ljVOJxc\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Cbmd7CRXSYNWgkRD3A5YJaaBrgY\"", "discoveryVersion": "v1", "id": "reseller:v1sandbox", "name": "reseller", "version": "v1sandbox", - "revision": "20141112", + "revision": "20150603", "title": "Enterprise Apps Reseller API", "description": "Lets you create and manage your customers and their subscriptions.", "ownerDomain": "google.com", @@ -314,6 +314,13 @@ "type": "string", "description": "The id of the subscription." }, + "suspensionReasons": { + "type": "array", + "description": "Suspension Reasons", + "items": { + "type": "string" + } + }, "transferInfo": { "type": "object", "description": "Transfer related information for the subscription.", diff --git a/etc/api/resourceviews/v1beta1/resourceviews-api.json b/etc/api/resourceviews/v1beta1/resourceviews-api.json index 2aeb266be2..14ffb1f0e0 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/bXwBH38JzEnpKy2cKLyUFEdOI50\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/TwzIqxwm2upGzUuQcHyTEbUiBn4\"", "discoveryVersion": "v1", "id": "resourceviews:v1beta1", "name": "resourceviews", "version": "v1beta1", - "revision": "20150302", + "revision": "20150326", "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 784d621446..87acc327a9 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/4MmDAPzSM7FP83q8Q6MVIkiIkKw\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/7vqttKoTimAxrx1G-cjy6Zjv7-U\"", "discoveryVersion": "v1", "id": "resourceviews:v1beta2", "name": "resourceviews", "version": "v1beta2", - "revision": "20150302", + "revision": "20150326", "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 3697ae9297..97bfdea54e 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/1SDe8olKAhBNATLmZ2G6zQS74JM\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/gwo7J97ILJAQ8gO-rmiOBs_ZkKc\"", "discoveryVersion": "v1", "id": "sqladmin:v1beta3", "name": "sqladmin", "canonicalName": "SQL Admin", "version": "v1beta3", - "revision": "20150305", + "revision": "20150330", "title": "Cloud SQL Administration API", "description": "API for Cloud SQL database instance management.", "ownerDomain": "google.com", @@ -15,7 +15,7 @@ "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" }, - "documentationLink": "https://developers.google.com/cloud-sql/docs/admin-api/", + "documentationLink": "https://cloud.google.com/sql/docs/reference/latest", "protocol": "rest", "baseUrl": "https://www.googleapis.com/sql/v1beta3/", "basePath": "/sql/v1beta3/", diff --git a/etc/api/sqladmin/v1beta4/sqladmin-api.json b/etc/api/sqladmin/v1beta4/sqladmin-api.json index 96b7f05419..38c3afff4c 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/meEPSemq72cDd2uWQHra_UPM5hU\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/5soduF8PrPVjL_-niuaFSHDnPoQ\"", "discoveryVersion": "v1", "id": "sqladmin:v1beta4", "name": "sqladmin", "canonicalName": "SQL Admin", "version": "v1beta4", - "revision": "20150305", + "revision": "20150330", "title": "Cloud SQL Administration API", "description": "API for Cloud SQL database instance management.", "ownerDomain": "google.com", @@ -15,7 +15,7 @@ "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" }, - "documentationLink": "https://developers.google.com/cloud-sql/docs/admin-api/", + "documentationLink": "https://cloud.google.com/sql/docs/reference/latest", "protocol": "rest", "baseUrl": "https://www.googleapis.com/sql/v1beta4/", "basePath": "/sql/v1beta4/", @@ -419,7 +419,7 @@ }, "state": { "type": "string", - "description": "The current serving state of the Cloud SQL instance. This can be one of the following.\nRUNNABLE: The instance is running, or is ready to run when accessed.\nSUSPENDED: The instance is not available, for example due to problems with billing.\nPENDING_CREATE: The instance is being created.\nMAINTENANCE: The instance is down for maintenance.\nUNKNOWN_STATE: The state of the instance is unknown." + "description": "The current serving state of the Cloud SQL instance. This can be one of the following.\nRUNNABLE: The instance is running, or is ready to run when accessed.\nSUSPENDED: The instance is not available, for example due to problems with billing.\nPENDING_CREATE: The instance is being created.\nMAINTENANCE: The instance is down for maintenance.\nFAILED: The instance creation failed.\nUNKNOWN_STATE: The state of the instance is unknown." } } }, @@ -802,7 +802,8 @@ "format": "date-time" }, "error": { - "$ref": "OperationErrors" + "$ref": "OperationErrors", + "description": "If errors occurred during processing of this operation, this field will be populated." }, "exportContext": { "$ref": "ExportContext", @@ -954,6 +955,10 @@ ] } }, + "instanceId": { + "type": "string", + "description": "The ID of the instance that the backup was taken from." + }, "kind": { "type": "string", "description": "This is always sql#restoreBackupContext.", @@ -1076,7 +1081,8 @@ "default": "sql#sslCert" }, "selfLink": { - "type": "string" + "type": "string", + "description": "The URI of this resource." }, "sha1Fingerprint": { "type": "string", diff --git a/etc/api/storage/v1/storage-api.json b/etc/api/storage/v1/storage-api.json index 380a51f606..4a1cf52f8b 100644 --- a/etc/api/storage/v1/storage-api.json +++ b/etc/api/storage/v1/storage-api.json @@ -1,6 +1,6 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/-eHE4ygU6pB-Rytn-s2uFnfwHbs\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/lTxRjj5-AURGfd9glUYk42wgbOA\"", "discoveryVersion": "v1", "id": "storage:v1", "name": "storage", @@ -575,7 +575,7 @@ }, "crc32c": { "type": "string", - "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64." + "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order." }, "etag": { "type": "string", @@ -782,10 +782,11 @@ "RewriteResponse": { "id": "RewriteResponse", "type": "object", - "description": "A Rewrite response.", + "description": "A rewrite response.", "properties": { "done": { - "type": "boolean" + "type": "boolean", + "description": "true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response." }, "kind": { "type": "string", @@ -794,16 +795,20 @@ }, "objectSize": { "type": "string", + "description": "The total size of the object being copied in bytes. This property is always present in the response.", "format": "uint64" }, "resource": { - "$ref": "Object" + "$ref": "Object", + "description": "A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes." }, "rewriteToken": { - "type": "string" + "type": "string", + "description": "A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy." }, "totalBytesRewritten": { "type": "string", + "description": "The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.", "format": "uint64" } } @@ -1935,7 +1940,7 @@ "id": "storage.objects.copy", "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}", "httpMethod": "POST", - "description": "Copies an object to a specified location. Optionally overrides metadata.", + "description": "Copies a source object to a destination object. Optionally overrides metadata.", "parameters": { "destinationBucket": { "type": "string", @@ -2573,7 +2578,7 @@ }, "maxBytesRewrittenPerCall": { "type": "string", - "description": "The maximum number of bytes that will be rewritten per Rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across Rewrite calls else you'll get an error that the rewrite token is invalid.", + "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.", "format": "int64", "location": "query" }, @@ -2592,7 +2597,7 @@ }, "rewriteToken": { "type": "string", - "description": "Include this field (from the previous Rewrite response) on each Rewrite request after the first one, until the Rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.", + "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.", "location": "query" }, "sourceBucket": { diff --git a/etc/api/tagmanager/v1/tagmanager-api.json b/etc/api/tagmanager/v1/tagmanager-api.json index 54f71999ac..2fbf9fc33e 100644 --- a/etc/api/tagmanager/v1/tagmanager-api.json +++ b/etc/api/tagmanager/v1/tagmanager-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/VOqeEOPH-o9v8dt3uW3tHJ6u1a4\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/RYltSVORyo-2lH4YNllLHLLyJN4\"", "discoveryVersion": "v1", "id": "tagmanager:v1", "name": "tagmanager", "canonicalName": "Tag Manager", "version": "v1", - "revision": "20150121", + "revision": "20150526", "title": "Tag Manager API", "description": "API for accessing Tag Manager accounts and containers.", "ownerDomain": "google.com", @@ -174,6 +174,7 @@ "description": "The type of operator for this condition.", "enum": [ "contains", + "cssSelector", "endsWith", "equals", "greater", @@ -192,6 +193,7 @@ "", "", "", + "", "" ], "annotations": { @@ -229,6 +231,12 @@ "items": { "type": "string", "enum": [ + "advertiserId", + "advertisingTrackingEnabled", + "appId", + "appName", + "appVersionCode", + "appVersionName", "clickClasses", "clickElement", "clickId", @@ -238,6 +246,7 @@ "containerId", "containerVersion", "debugMode", + "deviceName", "errorLine", "errorMessage", "errorUrl", @@ -249,15 +258,20 @@ "formText", "formUrl", "historySource", + "language", "newHistoryFragment", "newHistoryState", "oldHistoryFragment", "oldHistoryState", + "osVersion", "pageHostname", "pagePath", "pageUrl", + "platform", "randomNumber", - "referrer" + "referrer", + "resolution", + "sdkVersion" ], "enumDescriptions": [ "", @@ -288,6 +302,18 @@ "", "", "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", "" ] } diff --git a/etc/api/urlshortener/v1/urlshortener-api.json b/etc/api/urlshortener/v1/urlshortener-api.json index 943b2de4bd..896dd129a1 100644 --- a/etc/api/urlshortener/v1/urlshortener-api.json +++ b/etc/api/urlshortener/v1/urlshortener-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/hGOTAH4tOR9ybjNLhWvisea-41E\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/AatCAHtMEkXXklXOeUAsQ2bwGfw\"", "discoveryVersion": "v1", "id": "urlshortener:v1", "name": "urlshortener", "version": "v1", - "revision": "20150319", + "revision": "20150519", "title": "URL Shortener API", "description": "Lets you create, inspect, and manage goo.gl short URLs", "ownerDomain": "google.com", diff --git a/etc/api/youtube/v3/youtube-api.json b/etc/api/youtube/v3/youtube-api.json index dfc7c66539..778f250466 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/OsP2PPptQx1WtXrtO4-nK7efx8Q\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Ru_OFZL_9JBTrnQ2wlhRmAO3y_k\"", "discoveryVersion": "v1", "id": "youtube:v3", "name": "youtube", "canonicalName": "YouTube", "version": "v3", - "revision": "20150414", + "revision": "20150529", "title": "YouTube Data API", "description": "Programmatic access to YouTube features.", "ownerDomain": "google.com", @@ -1839,7 +1839,7 @@ }, "bmukkRating": { "type": "string", - "description": "Rating system for Austria - Bundesministeriums f�r Unterricht, Kunst und Kultur!", + "description": "Rating system for Austria - Bundesministerium f�r Unterricht, Kunst und Kultur", "enum": [ "bmukk10", "bmukk12", @@ -2069,7 +2069,9 @@ "cscf16", "cscf18", "cscf6", + "cscf9", "cscfA", + "cscfAl", "cscfUnrated" ], "enumDescriptions": [ @@ -2078,6 +2080,8 @@ "", "", "", + "", + "", "" ] }, @@ -2225,6 +2229,7 @@ "fcbm18sg", "fcbm18sx", "fcbmP13", + "fcbmPg13", "fcbmU", "fcbmUnrated" ], @@ -2236,6 +2241,7 @@ "", "", "", + "", "" ] }, @@ -2374,7 +2380,10 @@ "description": "Rating system in Ireland - Irish Film Classification Office", "enum": [ "ifco12", + "ifco12a", "ifco15", + "ifco15a", + "ifco16", "ifco18", "ifcoG", "ifcoPg", @@ -2386,6 +2395,9 @@ "", "", "", + "", + "", + "", "" ] }, @@ -2451,6 +2463,7 @@ "enum": [ "kijkwijzer12", "kijkwijzer16", + "kijkwijzer18", "kijkwijzer6", "kijkwijzer9", "kijkwijzerAl", @@ -2462,6 +2475,7 @@ "", "", "", + "", "" ] }, @@ -3572,9 +3586,16 @@ "$ref": "LiveBroadcastSnippet", "description": "The snippet object contains basic details about the event, including its title, description, start time, and end time." }, + "statistics": { + "$ref": "LiveBroadcastStatistics", + "description": "The statistics object contains info about the event's current stats. These include concurrent viewers and total chat count. Statistics can change (in either direction) during the lifetime of an event. Statistics are only returned while the event is live." + }, "status": { "$ref": "LiveBroadcastStatus", "description": "The status object contains information about the event's status." + }, + "topicDetails": { + "$ref": "LiveBroadcastTopicDetails" } } }, @@ -3618,6 +3639,9 @@ ] } }, + "enableLowLatency": { + "type": "boolean" + }, "monitorStream": { "$ref": "MonitorStreamInfo", "description": "The monitorStream object contains information about the monitor stream, which the broadcaster can use to review the event content before the broadcast stream is shown publicly." @@ -3708,6 +3732,9 @@ "type": "string", "description": "The broadcast's description. As with the title, you can set this field by modifying the broadcast resource or by setting the description field of the corresponding video resource." }, + "isDefaultBroadcast": { + "type": "boolean" + }, "publishedAt": { "type": "string", "description": "The date and time that the broadcast was added to YouTube's live broadcast schedule. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", @@ -3751,14 +3778,27 @@ } } }, + "LiveBroadcastStatistics": { + "id": "LiveBroadcastStatistics", + "type": "object", + "description": "Statistics about the live broadcast. These represent a snapshot of the values at the time of the request. Statistics are only returned for live broadcasts.", + "properties": { + "concurrentViewers": { + "type": "string", + "description": "The number of viewers currently watching the broadcast. The property and its value will be present if the broadcast has current viewers and the broadcast owner has not hidden the viewcount for the video. Note that YouTube stops tracking the number of concurrent viewers for a broadcast when the broadcast ends. So, this property would not identify the number of viewers watching an archived video of a live broadcast that already ended.", + "format": "uint64" + }, + "totalChatCount": { + "type": "string", + "description": "The total number of live chat messages currently on the broadcast. The property and its value will be present if the broadcast is public, has the live chat feature enabled, and has at least one message. Note that this field will not be filled after the broadcast ends. So this property would not identify the number of chat messages for an archived video of a completed live broadcast.", + "format": "uint64" + } + } + }, "LiveBroadcastStatus": { "id": "LiveBroadcastStatus", "type": "object", "properties": { - "isDefaultBroadcast": { - "type": "boolean", - "description": "Whether or not this broadcast is the default broadcast" - }, "lifeCycleStatus": { "type": "string", "description": "The broadcast's status. The status can be updated using the API's liveBroadcasts.transition method.", @@ -3839,6 +3879,56 @@ } } }, + "LiveBroadcastTopic": { + "id": "LiveBroadcastTopic", + "type": "object", + "properties": { + "snippet": { + "$ref": "LiveBroadcastTopicSnippet", + "description": "Information about the topic matched." + }, + "type": { + "type": "string", + "description": "The type of the topic.", + "enum": [ + "videoGame" + ], + "enumDescriptions": [ + "" + ] + }, + "unmatched": { + "type": "boolean", + "description": "If this flag is set it means that we have not been able to match the topic title and type provided to a known entity." + } + } + }, + "LiveBroadcastTopicDetails": { + "id": "LiveBroadcastTopicDetails", + "type": "object", + "properties": { + "topics": { + "type": "array", + "items": { + "$ref": "LiveBroadcastTopic" + } + } + } + }, + "LiveBroadcastTopicSnippet": { + "id": "LiveBroadcastTopicSnippet", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the topic." + }, + "releaseDate": { + "type": "string", + "description": "The date at which the topic was released. Filled for types: videoGame" + } + } + }, "LiveStream": { "id": "LiveStream", "type": "object", @@ -3880,6 +3970,108 @@ } } }, + "LiveStreamConfigurationIssue": { + "id": "LiveStreamConfigurationIssue", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "The long-form description of the issue and how to resolve it." + }, + "reason": { + "type": "string", + "description": "The short-form reason for this issue." + }, + "severity": { + "type": "string", + "description": "How severe this issue is to the stream.", + "enum": [ + "error", + "info", + "warning" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "type": { + "type": "string", + "description": "The kind of error happening.", + "enum": [ + "audioBitrate", + "audioBitrateHigh", + "audioBitrateLow", + "audioCodec", + "audioCodecMismatch", + "audioSampleRate", + "audioSampleRateMismatch", + "audioStereoMismatch", + "audioTooManyChannel", + "badContainer", + "bitrateHigh", + "bitrateLow", + "framerateHigh", + "framerateMismatch", + "gopMismatch", + "gopSizeLong", + "gopSizeOver", + "gopSizeShort", + "interlaceVideo", + "multipleAudioStreams", + "multipleVideoStreams", + "noAudioStream", + "noVideoStream", + "openGop", + "resolutionMismatch", + "videoBitrateMismatch", + "videoCodec", + "videoCodecMismatch", + "videoIngestionStarved", + "videoInterlaceMismatch", + "videoProfileMismatch", + "videoResolutionSuboptimal", + "videoResolutionUnsupported" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, "LiveStreamContentDetails": { "id": "LiveStreamContentDetails", "type": "object", @@ -3895,6 +4087,42 @@ } } }, + "LiveStreamHealthStatus": { + "id": "LiveStreamHealthStatus", + "type": "object", + "properties": { + "configurationIssues": { + "type": "array", + "description": "The configurations issues on this stream", + "items": { + "$ref": "LiveStreamConfigurationIssue" + } + }, + "lastUpdateTimeS": { + "type": "string", + "description": "The last time this status was updated (in seconds)", + "format": "uint64" + }, + "status": { + "type": "string", + "description": "The status code of this stream", + "enum": [ + "bad", + "good", + "noData", + "ok", + "revoked" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, "LiveStreamListResponse": { "id": "LiveStreamListResponse", "type": "object", @@ -3951,6 +4179,9 @@ "type": "string", "description": "The stream's description. The value cannot be longer than 10000 characters." }, + "isDefaultStream": { + "type": "boolean" + }, "publishedAt": { "type": "string", "description": "The date and time that the stream was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", @@ -3973,8 +4204,9 @@ "type": "object", "description": "Brief description of the live stream status.", "properties": { - "isDefaultStream": { - "type": "boolean" + "healthStatus": { + "$ref": "LiveStreamHealthStatus", + "description": "The health status of the stream." }, "streamStatus": { "type": "string", @@ -5049,15 +5281,6 @@ } } }, - "VideoAbuseReportReasonId": { - "id": "VideoAbuseReportReasonId", - "type": "object", - "properties": { - "value": { - "type": "string" - } - } - }, "VideoAbuseReportReasonListResponse": { "id": "VideoAbuseReportReasonListResponse", "type": "object", @@ -5111,7 +5334,7 @@ "type": "object", "properties": { "id": { - "$ref": "VideoAbuseReportReasonId", + "type": "string", "description": "The ID of this abuse report secondary reason." }, "label": { @@ -5812,6 +6035,10 @@ "type": "string", "description": "Channel title for the channel that the video belongs to." }, + "defaultAudioLanguage": { + "type": "string", + "description": "The default_audio_language property specifies the language spoken in the video's default audio track." + }, "defaultLanguage": { "type": "string", "description": "The language of the videos's default snippet." @@ -6168,7 +6395,7 @@ "parameters": { "part": { "type": "string", - "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and contentDetails.", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.", "required": true, "location": "query" } @@ -6224,7 +6451,7 @@ }, "part": { "type": "string", - "description": "The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties.", + "description": "The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties.", "required": true, "location": "query" }, @@ -6284,13 +6511,19 @@ "type": "string", "description": "ID of the Google+ Page for the channel that the request is be on behalf of", "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 actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" } }, "parameterOrder": [ "id" ], "scopes": [ - "https://www.googleapis.com/auth/youtube.force-ssl" + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" ] }, "download": { @@ -6316,6 +6549,11 @@ "description": "ID of the Google+ Page for the channel that the request is be on behalf of", "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 actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, "tfmt": { "type": "string", "description": "The tfmt parameter specifies that the caption track should be returned in a specific format. If the parameter is not included in the request, the track is returned in its original format.", @@ -6345,7 +6583,8 @@ "id" ], "scopes": [ - "https://www.googleapis.com/auth/youtube.force-ssl" + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" ], "supportsMediaDownload": true }, @@ -6366,6 +6605,11 @@ "description": "ID of the Google+ Page for the channel that the request is be on behalf of", "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 actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, "part": { "type": "string", "description": "The part parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet.", @@ -6388,7 +6632,8 @@ "$ref": "Caption" }, "scopes": [ - "https://www.googleapis.com/auth/youtube.force-ssl" + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" ], "supportsMediaUpload": true, "mediaUpload": { @@ -6432,6 +6677,11 @@ "description": "ID of the Google+ Page for the channel that the request is on behalf of.", "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 actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, "part": { "type": "string", "description": "The part parameter specifies a comma-separated list of one or more caption resource parts that the API response will include. The part names that you can include in the parameter value are id and snippet.", @@ -6453,7 +6703,8 @@ "$ref": "CaptionListResponse" }, "scopes": [ - "https://www.googleapis.com/auth/youtube.force-ssl" + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" ] }, "update": { @@ -6473,6 +6724,11 @@ "description": "ID of the Google+ Page for the channel that the request is be on behalf of", "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 actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, "part": { "type": "string", "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the property value to snippet if you are updating the track's draft status. Otherwise, set the property value to id.", @@ -6495,7 +6751,8 @@ "$ref": "Caption" }, "scopes": [ - "https://www.googleapis.com/auth/youtube.force-ssl" + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" ], "supportsMediaUpload": true, "mediaUpload": { @@ -6749,7 +7006,7 @@ }, "managedByMe": { "type": "boolean", - "description": "Set this parameter's value to true to instruct the API to only return channels managed by the content owner that the onBehalfOfContentOwner parameter specifies. The user must be authenticated as a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided.", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nSet this parameter's value to true to instruct the API to only return channels managed by the content owner that the onBehalfOfContentOwner parameter specifies. The user must be authenticated as a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided.", "location": "query" }, "maxResults": { @@ -6768,12 +7025,12 @@ }, "mySubscribers": { "type": "boolean", - "description": "Set this parameter's value to true to retrieve a list of channels that subscribed to the authenticated user's channel.", + "description": "Use the subscriptions.list method and its mySubscribers parameter to retrieve a list of subscribers to the authenticated user's channel.", "location": "query" }, "onBehalfOfContentOwner": { "type": "string", - "description": "The onBehalfOfContentOwner parameter indicates that the authenticated user 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 actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner.", + "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" }, "pageToken": { @@ -6783,7 +7040,7 @@ }, "part": { "type": "string", - "description": "The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, statistics, topicDetails, and invideoPromotion.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties.", + "description": "The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties.", "required": true, "location": "query" } @@ -6806,7 +7063,7 @@ "id": "youtube.channels.update", "path": "channels", "httpMethod": "PUT", - "description": "Updates a channel's metadata.", + "description": "Updates a channel's metadata. Note that this method currently only supports updates to the channel resource's brandingSettings and invideoPromotion objects and their child properties.", "parameters": { "onBehalfOfContentOwner": { "type": "string", @@ -6815,7 +7072,7 @@ }, "part": { "type": "string", - "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are id and invideoPromotion.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies.", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe API currently only allows the parameter value to be set to either brandingSettings or invideoPromotion. (You cannot update both of those parts with a single request.)\n\nNote that this method overrides the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies.", "required": true, "location": "query" } @@ -6843,17 +7100,17 @@ "id": "youtube.commentThreads.insert", "path": "commentThreads", "httpMethod": "POST", - "description": "Creates a new comment thread and top level comment.", + "description": "Creates a new top-level comment. To add a reply to an existing comment, use the comments.insert method instead.", "parameters": { "part": { "type": "string", - "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are id and snippet. However only snippet contains properties that can be set.", + "description": "The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units.", "required": true, "location": "query" }, "shareOnGooglePlus": { "type": "boolean", - "description": "The shareOnGooglePlus determines whether this thread should also be posted on Google+.", + "description": "The shareOnGooglePlus parameter indicates whether the top-level comment and any replies that are made to that comment should also be posted to the author's Google+ profile.", "default": "false", "location": "query" } @@ -6879,12 +7136,12 @@ "parameters": { "allThreadsRelatedToChannelId": { "type": "string", - "description": "The allThreadsRelatedToChannelId parameter instructs the API to return the comment threads of all videos of the channel and the channel comments as well.", + "description": "The allThreadsRelatedToChannelId parameter instructs the API to return all comment threads associated with the specified channel. The response can include comments about the channel or about the channel's videos.", "location": "query" }, "channelId": { "type": "string", - "description": "The channelId parameter instructs the API to return the comment threads for all the channel comments (not including comments left on videos).", + "description": "The channelId parameter instructs the API to return comment threads containing comments about the specified channel. (The response will not include comments left on videos that the channel uploaded.)", "location": "query" }, "id": { @@ -6904,16 +7161,30 @@ "moderationStatus": { "type": "string", "description": "Set this parameter to limit the returned comment threads to a particular moderation state.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.", - "default": "published", + "default": "MODERATION_STATUS_PUBLISHED", "enum": [ "heldForReview", "likelySpam", "published" ], "enumDescriptions": [ - "Returns only comment threads awaiting review by a moderator.", - "Returns only comment threads classified as likely being spam.", - "Returns only published comment threads." + "Retrieve comment threads that are awaiting review by a moderator. A comment thread can be included in the response if the top-level comment or at least one of the replies to that comment are awaiting review.", + "Retrieve comment threads classified as likely to be spam. A comment thread can be included in the response if the top-level comment or at least one of the replies to that comment is considered likely to be spam.", + "Retrieve threads of published comments. This is the default value. A comment thread can be included in the response if its top-level comment has been published." + ], + "location": "query" + }, + "order": { + "type": "string", + "description": "The order parameter specifies the order in which the API response should list comment threads. Valid values are: \n- time - Comment threads are ordered by time. This is the default behavior.\n- relevance - Comment threads are ordered by relevance.Note: This parameter is not supported for use in conjunction with the id parameter.", + "default": "true", + "enum": [ + "relevance", + "time" + ], + "enumDescriptions": [ + "Order by relevance.", + "Order by time." ], "location": "query" }, @@ -6924,13 +7195,13 @@ }, "part": { "type": "string", - "description": "The part parameter specifies the commentThread resource parts that the API response will include. Supported values are id, snippet and replies.", + "description": "The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include.", "required": true, "location": "query" }, "searchTerms": { "type": "string", - "description": "The searchTerms parameter instructs the API to limit the returned comments to those which contain the specified search terms.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.", + "description": "The searchTerms parameter instructs the API to limit the API response to only contain comments that contain the specified search terms.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.", "location": "query" }, "textFormat": { @@ -6942,14 +7213,14 @@ "plainText" ], "enumDescriptions": [ - "Returns the comments in HTML format.", + "Returns the comments in HTML format. This is the default value.", "Returns the comments in plain text format." ], "location": "query" }, "videoId": { "type": "string", - "description": "The videoId parameter instructs the API to return the comment threads for the video specified by the video id.", + "description": "The videoId parameter instructs the API to return comment threads associated with the specified video ID.", "location": "query" } }, @@ -6967,11 +7238,11 @@ "id": "youtube.commentThreads.update", "path": "commentThreads", "httpMethod": "PUT", - "description": "Modifies an existing comment.", + "description": "Modifies the top-level comment in a comment thread.", "parameters": { "part": { "type": "string", - "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are id, snippet and replies. However only snippet contains properties that can be updated.", + "description": "The part parameter specifies a comma-separated list of commentThread resource properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update.", "required": true, "location": "query" } @@ -7001,7 +7272,7 @@ "parameters": { "id": { "type": "string", - "description": "The id parameter specifies the comment ID for the resource that should be deleted.", + "description": "The id parameter specifies the comment ID for the resource that is being deleted.", "required": true, "location": "query" } @@ -7017,11 +7288,11 @@ "id": "youtube.comments.insert", "path": "comments", "httpMethod": "POST", - "description": "Creates a new comment.\n\nNote: to create a top level comment it is also necessary to create a comment thread. Both are accomplished through the commentThreads resource.", + "description": "Creates a reply to an existing comment. Note: To create a top-level comment, use the commentThreads.insert method.", "parameters": { "part": { "type": "string", - "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are id and snippet. However only snippet contains properties that can be set.", + "description": "The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units.", "required": true, "location": "query" } @@ -7047,7 +7318,7 @@ "parameters": { "id": { "type": "string", - "description": "The id parameter specifies a comma-separated list of comment IDs for the resources that should be retrieved.", + "description": "The id parameter specifies a comma-separated list of comment IDs for the resources that are being retrieved. In a comment resource, the id property specifies the comment's ID.", "location": "query" }, "maxResults": { @@ -7066,25 +7337,25 @@ }, "parentId": { "type": "string", - "description": "The parentId parameter specifies the ID of the comment for which replies should be retrieved.\n\nNote: Currently YouTube features only one level of replies (ie replies to top level comments). However replies to replies may be supported in the future.", + "description": "The parentId parameter specifies the ID of the comment for which replies should be retrieved.\n\nNote: YouTube currently supports replies only for top-level comments. However, replies to replies may be supported in the future.", "location": "query" }, "part": { "type": "string", - "description": "The part parameter specifies the comment resource parts that the API response will include. Supported values are id and snippet.", + "description": "The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include.", "required": true, "location": "query" }, "textFormat": { "type": "string", - "description": "Set this parameter's value to html or plainText to instruct the API to return the comments left by users formatted as HTML or as plain text.", + "description": "This parameter indicates whether the API should return comments formatted as HTML or as plain text.", "default": "FORMAT_HTML", "enum": [ "html", "plainText" ], "enumDescriptions": [ - "Returns the comments in HTML format.", + "Returns the comments in HTML format. This is the default value.", "Returns the comments in plain text format." ], "location": "query" @@ -7104,11 +7375,11 @@ "id": "youtube.comments.markAsSpam", "path": "comments/markAsSpam", "httpMethod": "POST", - "description": "Expresses the caller's opinion that a comment is spam.", + "description": "Expresses the caller's opinion that one or more comments should be flagged as spam.", "parameters": { "id": { "type": "string", - "description": "The id parameter specifies a comma-separated list of IDs of comments which should get flagged as spam.", + "description": "The id parameter specifies a comma-separated list of IDs of comments that the caller believes should be classified as spam.", "required": true, "location": "query" } @@ -7124,23 +7395,23 @@ "id": "youtube.comments.setModerationStatus", "path": "comments/setModerationStatus", "httpMethod": "POST", - "description": "Sets the moderation status of one or more comments.", + "description": "Sets the moderation status of one or more comments. The API request must be authorized by the owner of the channel or video associated with the comments.", "parameters": { "banAuthor": { "type": "boolean", - "description": "The banAuthor paramter, if set to true, adds the author of the comment to the ban list. This means all future comments of the author will autmomatically be rejected.\n\nNote: This parameter is only valid in combination with moderationStatus 'rejected'.", + "description": "The banAuthor parameter lets you indicate that you want to automatically reject any additional comments written by the comment's author. Set the parameter value to true to ban the author.\n\nNote: This parameter is only valid if the moderationStatus parameter is also set to rejected.", "default": "false", "location": "query" }, "id": { "type": "string", - "description": "The id parameter specifies a comma-separated list of IDs of comments whose moderation status should be updated.", + "description": "The id parameter specifies a comma-separated list of IDs that identify the comments for which you are updating the moderation status.", "required": true, "location": "query" }, "moderationStatus": { "type": "string", - "description": "Determines the new moderation status of the specified comments.", + "description": "Identifies the new moderation status of the specified comments.", "required": true, "enum": [ "heldForReview", @@ -7150,7 +7421,7 @@ "enumDescriptions": [ "Marks a comment as awaiting review by a moderator.", "Clears a comment for public display.", - "Rejects a comment as not fit for display.\n\nNote: currently there is no way to list or otherwise discover a rejected comment. However it is possible to change its moderation status as long as its ID is still known.\n\nNote: Currently, if you reject a comment you effectively also hide all its replies as there is no longer any way to discover them. This may change in the future." + "Rejects a comment as being unfit for display. This action also effectively hides all replies to the rejected comment.\n\nNote: The API does not currently provide a way to list or otherwise discover rejected comments. However, you can change the moderation status of a rejected comment if you still know its ID. If you were to change the moderation status of a rejected comment, the comment replies would subsequently be discoverable again as well." ], "location": "query" } @@ -7167,11 +7438,11 @@ "id": "youtube.comments.update", "path": "comments", "httpMethod": "PUT", - "description": "Modifies an existing comment.", + "description": "Modifies a comment.", "parameters": { "part": { "type": "string", - "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are id and snippet. However only snippet contains properties that can be updated.", + "description": "The part parameter identifies the properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update.", "required": true, "location": "query" } @@ -7212,7 +7483,7 @@ }, "part": { "type": "string", - "description": "The part parameter specifies a comma-separated list of one or more guideCategory resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a guideCategory resource, the snippet property contains other properties, such as the category's title. If you set part=snippet, the API response will also contain all of those nested properties.", + "description": "The part parameter specifies the guideCategory resource properties that the API response will include. Set the parameter value to snippet.", "required": true, "location": "query" }, @@ -7243,7 +7514,7 @@ "id": "youtube.i18nLanguages.list", "path": "i18nLanguages", "httpMethod": "GET", - "description": "Returns a list of supported languages.", + "description": "Returns a list of application languages that the YouTube website supports.", "parameters": { "hl": { "type": "string", @@ -7253,7 +7524,7 @@ }, "part": { "type": "string", - "description": "The part parameter specifies a comma-separated list of one or more i18nLanguage resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet.", + "description": "The part parameter specifies the i18nLanguage resource properties that the API response will include. Set the parameter value to snippet.", "required": true, "location": "query" } @@ -7279,7 +7550,7 @@ "id": "youtube.i18nRegions.list", "path": "i18nRegions", "httpMethod": "GET", - "description": "Returns a list of supported regions.", + "description": "Returns a list of content regions that the YouTube website supports.", "parameters": { "hl": { "type": "string", @@ -7289,7 +7560,7 @@ }, "part": { "type": "string", - "description": "The part parameter specifies a comma-separated list of one or more i18nRegion resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet.", + "description": "The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet.", "required": true, "location": "query" } @@ -7315,7 +7586,7 @@ "id": "youtube.liveBroadcasts.bind", "path": "liveBroadcasts/bind", "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.", + "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", @@ -7739,7 +8010,7 @@ }, "maxResults": { "type": "integer", - "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set. Acceptable values are 0 to 50, inclusive. The default value is 5.", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", "default": "5", "format": "uint32", "minimum": "0", @@ -7861,7 +8132,7 @@ }, "part": { "type": "string", - "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet, contentDetails, and status.", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.", "required": true, "location": "query" } @@ -7913,7 +8184,7 @@ }, "part": { "type": "string", - "description": "The part parameter specifies a comma-separated list of one or more playlistItem 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.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties.", + "description": "The part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties.", "required": true, "location": "query" }, @@ -7950,7 +8221,7 @@ "parameters": { "part": { "type": "string", - "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet, contentDetails, and status.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist item can specify a start time and end time, which identify the times portion of the video that should play when users watch the video in the playlist. If your request is updating a playlist item that sets these values, and the request's part parameter value includes the contentDetails part, the playlist item's start and end times will be updated to whatever value the request body specifies. If the request body does not specify values, the existing start and end times will be removed and replaced with the default settings.", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist item can specify a start time and end time, which identify the times portion of the video that should play when users watch the video in the playlist. If your request is updating a playlist item that sets these values, and the request's part parameter value includes the contentDetails part, the playlist item's start and end times will be updated to whatever value the request body specifies. If the request body does not specify values, the existing start and end times will be removed and replaced with the default settings.", "required": true, "location": "query" } @@ -8019,7 +8290,7 @@ }, "part": { "type": "string", - "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and status.", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.", "required": true, "location": "query" } @@ -8091,7 +8362,7 @@ }, "part": { "type": "string", - "description": "The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, status, and contentDetails.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties.", + "description": "The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties.", "required": true, "location": "query" } @@ -8122,7 +8393,7 @@ }, "part": { "type": "string", - "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and status.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist's privacy setting is contained in the status part. As such, if your request is updating a private playlist, and the request's part parameter value includes the status part, the playlist's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the playlist will revert to the default privacy setting.", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that this method will override the existing values for mutable properties that are contained in any parts that the request body specifies. For example, a playlist's description is contained in the snippet part, which must be included in the request body. If the request does not specify a value for the snippet.description property, the playlist's existing description will be deleted.", "required": true, "location": "query" } @@ -8172,7 +8443,7 @@ }, "eventType": { "type": "string", - "description": "The eventType parameter restricts a search to broadcast events.", + "description": "The eventType parameter restricts a search to broadcast events. If you specify a value for this parameter, you must also set the type parameter's value to video.", "enum": [ "completed", "live", @@ -8202,12 +8473,12 @@ }, "location": { "type": "string", - "description": "The location parameter restricts a search to videos that have a geographical location specified in their metadata. The value is a string that specifies geographic latitude/longitude coordinates e.g. (37.42307,-122.08427)", + "description": "The location parameter, in conjunction with the locationRadius parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427).\n\n\n- The location parameter value identifies the point at the center of the area.\n- The locationRadius parameter specifies the maximum distance that the location associated with a video can be from that point for the video to still be included in the search results.The API returns an error if your request specifies a value for the location parameter but does not also specify a value for the locationRadius parameter.", "location": "query" }, "locationRadius": { "type": "string", - "description": "The locationRadius, in conjunction with the location parameter, defines a geographic area. If the geographic coordinates associated with a video fall within that area, then the video may be included in search results. This parameter value must be a floating point number followed by a measurement unit. Valid measurement units are m, km, ft, and mi. For example, valid parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not support locationRadius parameter values larger than 1000 kilometers.", + "description": "The locationRadius parameter, in conjunction with the location parameter, defines a circular geographic area.\n\nThe parameter value must be a floating point number followed by a measurement unit. Valid measurement units are m, km, ft, and mi. For example, valid parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not support locationRadius parameter values larger than 1000 kilometers.\n\nNote: See the definition of the location parameter for more information.", "location": "query" }, "maxResults": { @@ -8253,7 +8524,7 @@ }, "part": { "type": "string", - "description": "The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a search result, the snippet property contains other properties that identify the result's title, description, and so forth. If you set part=snippet, the API response will also contain all of those nested properties.", + "description": "The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. Set the parameter value to snippet.", "required": true, "location": "query" }, @@ -8271,7 +8542,7 @@ }, "q": { "type": "string", - "description": "The q parameter specifies the query term to search for.", + "description": "The q parameter specifies the query term to search for.\n\nYour request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either \"boating\" or \"sailing\", set the q parameter value to boating|sailing. Similarly, to search for videos matching either \"boating\" or \"sailing\" but not \"fishing\", set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C.", "location": "query" }, "regionCode": { @@ -8317,7 +8588,7 @@ }, "videoCaption": { "type": "string", - "description": "The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions.", + "description": "The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions. If you specify a value for this parameter, you must also set the type parameter's value to video.", "enum": [ "any", "closedCaption", @@ -8332,12 +8603,12 @@ }, "videoCategoryId": { "type": "string", - "description": "The videoCategoryId parameter filters video search results based on their category.", + "description": "The videoCategoryId parameter filters video search results based on their category. If you specify a value for this parameter, you must also set the type parameter's value to video.", "location": "query" }, "videoDefinition": { "type": "string", - "description": "The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available.", + "description": "The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available. If you specify a value for this parameter, you must also set the type parameter's value to video.", "enum": [ "any", "high", @@ -8352,7 +8623,7 @@ }, "videoDimension": { "type": "string", - "description": "The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos.", + "description": "The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos. If you specify a value for this parameter, you must also set the type parameter's value to video.", "enum": [ "2d", "3d", @@ -8367,7 +8638,7 @@ }, "videoDuration": { "type": "string", - "description": "The videoDuration parameter filters video search results based on their duration.", + "description": "The videoDuration parameter filters video search results based on their duration. If you specify a value for this parameter, you must also set the type parameter's value to video.", "enum": [ "any", "long", @@ -8384,7 +8655,7 @@ }, "videoEmbeddable": { "type": "string", - "description": "The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage.", + "description": "The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage. If you specify a value for this parameter, you must also set the type parameter's value to video.", "enum": [ "any", "true" @@ -8397,7 +8668,7 @@ }, "videoLicense": { "type": "string", - "description": "The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos.", + "description": "The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos. If you specify a value for this parameter, you must also set the type parameter's value to video.", "enum": [ "any", "creativeCommon", @@ -8412,7 +8683,7 @@ }, "videoSyndicated": { "type": "string", - "description": "The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com.", + "description": "The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com. If you specify a value for this parameter, you must also set the type parameter's value to video.", "enum": [ "any", "true" @@ -8425,7 +8696,7 @@ }, "videoType": { "type": "string", - "description": "The videoType parameter lets you restrict a search to a particular type of videos.", + "description": "The videoType parameter lets you restrict a search to a particular type of videos. If you specify a value for this parameter, you must also set the type parameter's value to video.", "enum": [ "any", "episode", @@ -8486,7 +8757,7 @@ "parameters": { "part": { "type": "string", - "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and contentDetails.", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.", "required": true, "location": "query" } @@ -8579,7 +8850,7 @@ }, "part": { "type": "string", - "description": "The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties.", + "description": "The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties.", "required": true, "location": "query" } @@ -8609,7 +8880,7 @@ "parameters": { "onBehalfOfContentOwner": { "type": "string", - "description": "The onBehalfOfContentOwner parameter indicates that the authenticated user 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 actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner.", + "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 actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", "location": "query" }, "videoId": { @@ -8709,7 +8980,7 @@ }, "part": { "type": "string", - "description": "The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet.", + "description": "The part parameter specifies the videoCategory resource properties that the API response will include. Set the parameter value to snippet.", "required": true, "location": "query" }, @@ -8806,7 +9077,7 @@ }, "notifySubscribers": { "type": "boolean", - "description": "The notifySubscribers parameter indicates whether YouTube should send notification to subscribers about the inserted video.", + "description": "The notifySubscribers parameter indicates whether YouTube should send a notification about the new video to users who subscribe to the video's channel. A parameter value of True indicates that subscribers will be notified of newly uploaded videos. However, a channel owner who is uploading many videos might prefer to set the value to False to avoid sending a notification about each new video to the channel's subscribers.", "default": "true", "location": "query" }, @@ -8822,7 +9093,7 @@ }, "part": { "type": "string", - "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet, contentDetails, fileDetails, liveStreamingDetails, localizations, player, processingDetails, recordingDetails, statistics, status, suggestions, and topicDetails. However, not all of those parts contain properties that can be set when setting or updating a video's metadata. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.", "required": true, "location": "query" }, @@ -8883,9 +9154,15 @@ ], "location": "query" }, + "debugProjectIdOverride": { + "type": "string", + "description": "The debugProjectIdOverride parameter should be used for mimicking a request for a certain project ID", + "format": "int64", + "location": "query" + }, "hl": { "type": "string", - "description": "The hl parameter instructs the API to return a localized version of the video details. If localized text is nor available for the requested language, the localizations object in the API response will contain the requested information in the default language instead. The parameter value is a BCP-47 language code. Your application can determine whether the requested localization was returned by checking the value of the snippet.localized.language property in the API response.", + "description": "The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method.\n\nIf localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language.", "location": "query" }, "id": { @@ -8932,7 +9209,7 @@ }, "part": { "type": "string", - "description": "The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, fileDetails, liveStreamingDetails, localizations, player, processingDetails, recordingDetails, statistics, status, suggestions, and topicDetails.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties.", + "description": "The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties.", "required": true, "location": "query" }, @@ -8973,11 +9250,6 @@ "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" - }, "rating": { "type": "string", "description": "Specifies the rating to record.", @@ -9039,7 +9311,7 @@ }, "part": { "type": "string", - "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet, contentDetails, fileDetails, liveStreamingDetails, localizations, player, processingDetails, recordingDetails, statistics, status, suggestions, and topicDetails.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a video's privacy setting is contained in the status part. As such, if your request is updating a private video, and the request's part parameter value includes the status part, the video's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the video will revert to the default privacy setting.\n\nIn addition, not all of those parts contain properties that can be set when setting or updating a video's metadata. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a video's privacy setting is contained in the status part. As such, if your request is updating a private video, and the request's part parameter value includes the status part, the video's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the video will revert to the default privacy setting.\n\nIn addition, not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.", "required": true, "location": "query" } @@ -9071,13 +9343,13 @@ "parameters": { "channelId": { "type": "string", - "description": "The channelId parameter specifies a YouTube channel ID for which the watermark is being provided.", + "description": "The channelId parameter specifies the YouTube channel ID for which the watermark is being provided.", "required": true, "location": "query" }, "onBehalfOfContentOwner": { "type": "string", - "description": "The onBehalfOfContentOwner parameter indicates that the authenticated user 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 actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner.", + "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" } }, @@ -9117,17 +9389,17 @@ "id": "youtube.watermarks.unset", "path": "watermarks/unset", "httpMethod": "POST", - "description": "Deletes a watermark.", + "description": "Deletes a channel's watermark image.", "parameters": { "channelId": { "type": "string", - "description": "The channelId parameter specifies a YouTube channel ID for which the watermark is being unset.", + "description": "The channelId parameter specifies the YouTube channel ID for which the watermark is being unset.", "required": true, "location": "query" }, "onBehalfOfContentOwner": { "type": "string", - "description": "The onBehalfOfContentOwner parameter indicates that the authenticated user 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 actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner.", + "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" } }, diff --git a/gen/adexchangebuyer1d3-cli/Cargo.toml b/gen/adexchangebuyer1d3-cli/Cargo.toml index c661d8a667..59cc23d641 100644 --- a/gen/adexchangebuyer1d3-cli/Cargo.toml +++ b/gen/adexchangebuyer1d3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangebuyer1d3-cli" -version = "0.3.0+20150326" +version = "0.3.0+20150520" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d3-cli" @@ -17,8 +17,8 @@ keywords = ["adexchangebuyer", "google", "cli"] name = "adexchangebuyer1d3" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/adexchangebuyer1d3-cli/README.md b/gen/adexchangebuyer1d3-cli/README.md index ee19f1effa..ea20e1d82e 100644 --- a/gen/adexchangebuyer1d3-cli/README.md +++ b/gen/adexchangebuyer1d3-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Ad Exchange Buyer* API at revision *20150326*. The CLI is at version *0.3.0*. +This documentation was generated from the *Ad Exchange Buyer* API at revision *20150520*. The CLI is at version *0.3.0*. ```bash adexchangebuyer1d3 [options] diff --git a/gen/adexchangebuyer1d3-cli/mkdocs.yml b/gen/adexchangebuyer1d3-cli/mkdocs.yml index cd792d1bf0..5a787d0552 100644 --- a/gen/adexchangebuyer1d3-cli/mkdocs.yml +++ b/gen/adexchangebuyer1d3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Exchange Buyer v0.3.0+20150326 +site_name: Ad Exchange Buyer v0.3.0+20150520 site_url: http://byron.github.io/google-apis-rs/google-adexchangebuyer1d3-cli site_description: Write integrating applications with bcore diff --git a/gen/adexchangebuyer1d3-cli/src/main.rs b/gen/adexchangebuyer1d3-cli/src/main.rs index 08dd419b62..00f829f4b4 100644 --- a/gen/adexchangebuyer1d3-cli/src/main.rs +++ b/gen/adexchangebuyer1d3-cli/src/main.rs @@ -90,6 +90,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -141,6 +142,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -232,6 +234,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -323,6 +326,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -375,6 +379,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -426,6 +431,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -477,6 +483,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -566,6 +573,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -655,6 +663,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -707,6 +716,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -808,6 +818,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -875,6 +886,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -926,6 +938,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -977,6 +990,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1035,6 +1049,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1130,6 +1145,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1233,6 +1249,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1284,6 +1301,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1387,6 +1405,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1490,6 +1509,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1654,7 +1674,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() @@ -1667,7 +1687,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() @@ -2261,7 +2281,7 @@ fn main() { let mut app = App::new("adexchangebuyer1d3") .author("Sebastian Thiel ") - .version("0.3.0+20150326") + .version("0.3.0+20150520") .about("Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adexchangebuyer1d3_cli") .arg(Arg::with_name("url") diff --git a/gen/adexchangebuyer1d3/Cargo.toml b/gen/adexchangebuyer1d3/Cargo.toml index 27be646b1b..70c51c923e 100644 --- a/gen/adexchangebuyer1d3/Cargo.toml +++ b/gen/adexchangebuyer1d3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangebuyer1d3" -version = "0.1.8+20150326" +version = "0.1.8+20150520" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d3" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/adexchangebuyer1d3/README.md b/gen/adexchangebuyer1d3/README.md index ea4bed6e09..e94b2e6534 100644 --- a/gen/adexchangebuyer1d3/README.md +++ b/gen/adexchangebuyer1d3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-adexchangebuyer1d3` library allows access to all features of the *Google Ad Exchange Buyer* service. -This documentation was generated from *Ad Exchange Buyer* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Ad Exchange Buyer* crate version *0.1.8+20150520*, where *20150520* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *Ad Exchange Buyer* *v1d3* API can be found at the [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). diff --git a/gen/adexchangebuyer1d3/src/cmn.rs b/gen/adexchangebuyer1d3/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/adexchangebuyer1d3/src/cmn.rs +++ b/gen/adexchangebuyer1d3/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/adexchangebuyer1d3/src/lib.rs b/gen/adexchangebuyer1d3/src/lib.rs index 71213d1da0..3e470a17fa 100644 --- a/gen/adexchangebuyer1d3/src/lib.rs +++ b/gen/adexchangebuyer1d3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Ad Exchange Buyer* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Ad Exchange Buyer* crate version *0.1.8+20150520*, where *20150520* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *Ad Exchange Buyer* *v1d3* API can be found at the //! [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). diff --git a/gen/adexchangebuyer1d3/src/lib.rs.in b/gen/adexchangebuyer1d3/src/lib.rs.in index d4995a396d..a64273b9cd 100644 --- a/gen/adexchangebuyer1d3/src/lib.rs.in +++ b/gen/adexchangebuyer1d3/src/lib.rs.in @@ -571,11 +571,18 @@ pub struct PerformanceReport { /// Average QPS for hosted match operations. #[serde(rename="hostedMatchStatusRate")] pub hosted_match_status_rate: Option>, - /// The unix timestamp of the starting time of this performance data. - pub timestamp: Option, + /// The number of bid requests sent to your bidder. + #[serde(rename="bidRequestRate")] + pub bid_request_rate: Option, + /// The number of bid responses that were unsuccessful due to timeouts, incorrect formatting, etc. + #[serde(rename="unsuccessfulRequestRate")] + pub unsuccessful_request_rate: Option, /// The 50th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report. #[serde(rename="latency50thPercentile")] pub latency50th_percentile: Option, + /// The number of properly formed bid responses received by our servers within the deadline. + #[serde(rename="successfulRequestRate")] + pub successful_request_rate: Option, /// The 85th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report. #[serde(rename="latency85thPercentile")] pub latency85th_percentile: Option, @@ -593,17 +600,28 @@ pub struct PerformanceReport { pub no_quota_in_region: Option, /// Resource type. pub kind: Option, + /// The number of potential queries based on your pretargeting settings. + #[serde(rename="inventoryMatchRate")] + pub inventory_match_rate: Option, /// The trading location of this data. pub region: Option, + /// The number of bid responses with an ad. + #[serde(rename="bidRate")] + pub bid_rate: Option, /// The configured quota limits for this account. #[serde(rename="quotaConfiguredLimit")] pub quota_configured_limit: Option, /// Rate of various quota account statuses per quota check. #[serde(rename="outOfQuota")] pub out_of_quota: Option, + /// The unix timestamp of the starting time of this performance data. + pub timestamp: Option, /// The throttled quota limits for this account. #[serde(rename="quotaThrottledLimit")] pub quota_throttled_limit: Option, + /// The number of bid responses that were filtered due to a policy violation or other errors. + #[serde(rename="filteredBidRate")] + pub filtered_bid_rate: Option, /// Average QPS for pixel match requests from clients. #[serde(rename="pixelMatchRequests")] pub pixel_match_requests: Option, diff --git a/gen/adexchangeseller2-cli/Cargo.toml b/gen/adexchangeseller2-cli/Cargo.toml index 6c7418c5ca..007ae5f602 100644 --- a/gen/adexchangeseller2-cli/Cargo.toml +++ b/gen/adexchangeseller2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangeseller2-cli" -version = "0.3.0+20150326" +version = "0.3.0+20150617" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Seller (protocol v2.0)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangeseller2-cli" @@ -17,8 +17,8 @@ keywords = ["adexchangeseller", "google", "cli"] name = "adexchangeseller2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/adexchangeseller2-cli/README.md b/gen/adexchangeseller2-cli/README.md index fccf3842f3..540330e319 100644 --- a/gen/adexchangeseller2-cli/README.md +++ b/gen/adexchangeseller2-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Ad Exchange Seller* API at revision *20150326*. The CLI is at version *0.3.0*. +This documentation was generated from the *Ad Exchange Seller* API at revision *20150617*. The CLI is at version *0.3.0*. ```bash adexchangeseller2 [options] diff --git a/gen/adexchangeseller2-cli/mkdocs.yml b/gen/adexchangeseller2-cli/mkdocs.yml index 82f5916bcf..d2494412f2 100644 --- a/gen/adexchangeseller2-cli/mkdocs.yml +++ b/gen/adexchangeseller2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Exchange Seller v0.3.0+20150326 +site_name: Ad Exchange Seller v0.3.0+20150617 site_url: http://byron.github.io/google-apis-rs/google-adexchangeseller2-cli site_description: Write integrating applications with bcore diff --git a/gen/adexchangeseller2-cli/src/main.rs b/gen/adexchangeseller2-cli/src/main.rs index ea769b9238..abd64f163b 100644 --- a/gen/adexchangeseller2-cli/src/main.rs +++ b/gen/adexchangeseller2-cli/src/main.rs @@ -96,6 +96,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -151,6 +152,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -202,6 +204,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -260,6 +263,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -311,6 +315,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -369,6 +374,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -420,6 +426,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -471,6 +478,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -522,6 +530,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -573,6 +582,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -651,8 +661,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -715,6 +727,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -773,6 +786,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -831,6 +845,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -926,7 +941,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() @@ -939,7 +954,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() @@ -1331,7 +1346,7 @@ fn main() { let mut app = App::new("adexchangeseller2") .author("Sebastian Thiel ") - .version("0.3.0+20150326") + .version("0.3.0+20150617") .about("Gives Ad Exchange seller users access to their inventory and the ability to generate reports") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adexchangeseller2_cli") .arg(Arg::with_name("url") diff --git a/gen/adexchangeseller2/Cargo.toml b/gen/adexchangeseller2/Cargo.toml index a513d13a27..de84304878 100644 --- a/gen/adexchangeseller2/Cargo.toml +++ b/gen/adexchangeseller2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangeseller2" -version = "0.1.8+20150326" +version = "0.1.8+20150617" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Seller (protocol v2.0)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangeseller2" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/adexchangeseller2/README.md b/gen/adexchangeseller2/README.md index c7c5388699..b3f304d5b5 100644 --- a/gen/adexchangeseller2/README.md +++ b/gen/adexchangeseller2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-adexchangeseller2` library allows access to all features of the *Google Ad Exchange Seller* service. -This documentation was generated from *Ad Exchange Seller* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Ad Exchange Seller* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *Ad Exchange Seller* *v2* API can be found at the [official documentation site](https://developers.google.com/ad-exchange/seller-rest/). diff --git a/gen/adexchangeseller2/src/cmn.rs b/gen/adexchangeseller2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/adexchangeseller2/src/cmn.rs +++ b/gen/adexchangeseller2/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/adexchangeseller2/src/lib.rs b/gen/adexchangeseller2/src/lib.rs index c89bf18718..7d5e45f07b 100644 --- a/gen/adexchangeseller2/src/lib.rs +++ b/gen/adexchangeseller2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Ad Exchange Seller* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Ad Exchange Seller* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *Ad Exchange Seller* *v2* API can be found at the //! [official documentation site](https://developers.google.com/ad-exchange/seller-rest/). diff --git a/gen/admin1_directory-cli/Cargo.toml b/gen/admin1_directory-cli/Cargo.toml index aad5b62697..27bbc70900 100644 --- a/gen/admin1_directory-cli/Cargo.toml +++ b/gen/admin1_directory-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin1_directory-cli" -version = "0.3.0+20150314" +version = "0.3.0+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with directory (protocol directory_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_directory-cli" @@ -17,8 +17,8 @@ keywords = ["admin", "google", "cli"] name = "admin1-directory" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/admin1_directory-cli/README.md b/gen/admin1_directory-cli/README.md index 5fc05487f4..1203fd7b09 100644 --- a/gen/admin1_directory-cli/README.md +++ b/gen/admin1_directory-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *directory* API at revision *20150314*. The CLI is at version *0.3.0*. +This documentation was generated from the *directory* API at revision *20150326*. The CLI is at version *0.3.0*. ```bash admin1-directory [options] diff --git a/gen/admin1_directory-cli/mkdocs.yml b/gen/admin1_directory-cli/mkdocs.yml index 99fd329124..f87bbc2b51 100644 --- a/gen/admin1_directory-cli/mkdocs.yml +++ b/gen/admin1_directory-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: directory v0.3.0+20150314 +site_name: directory v0.3.0+20150326 site_url: http://byron.github.io/google-apis-rs/google-admin1_directory-cli site_description: Write integrating applications with bcore diff --git a/gen/admin1_directory-cli/src/main.rs b/gen/admin1_directory-cli/src/main.rs index ba3cf892e8..8a81abac45 100644 --- a/gen/admin1_directory-cli/src/main.rs +++ b/gen/admin1_directory-cli/src/main.rs @@ -135,6 +135,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -186,6 +187,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -327,6 +329,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -397,6 +400,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -507,6 +511,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -617,6 +622,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -749,6 +755,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -800,6 +807,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -895,6 +903,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -988,6 +997,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1055,6 +1065,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1148,6 +1159,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1241,6 +1253,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1336,6 +1349,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1425,6 +1439,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1486,6 +1501,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1575,6 +1591,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1664,6 +1681,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1840,6 +1858,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1910,6 +1929,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2005,6 +2025,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2066,6 +2087,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2157,6 +2179,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2248,6 +2271,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2343,6 +2367,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2435,6 +2460,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2493,6 +2519,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2585,6 +2612,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2677,6 +2705,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2772,6 +2801,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2859,6 +2889,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2910,6 +2941,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2997,6 +3029,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3084,6 +3117,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3179,6 +3213,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3230,6 +3265,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3362,6 +3398,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3417,6 +3454,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3514,6 +3552,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3619,6 +3658,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3649,6 +3689,7 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "is-delegated-admin" => Some(("isDelegatedAdmin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "thumbnail-photo-etag" => Some(("thumbnailPhotoEtag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "suspended" => Some(("suspended", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "aliases" => Some(("aliases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -3675,7 +3716,7 @@ impl<'n, 'a> Engine<'n, 'a> { "change-password-at-next-login" => Some(("changePasswordAtNextLogin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3728,6 +3769,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3816,6 +3858,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3923,6 +3966,7 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "is-delegated-admin" => Some(("isDelegatedAdmin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "thumbnail-photo-etag" => Some(("thumbnailPhotoEtag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "suspended" => Some(("suspended", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "aliases" => Some(("aliases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -3949,7 +3993,7 @@ impl<'n, 'a> Engine<'n, 'a> { "change-password-at-next-login" => Some(("changePasswordAtNextLogin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4002,6 +4046,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4097,6 +4142,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4188,6 +4234,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4279,6 +4326,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4386,6 +4434,7 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "is-delegated-admin" => Some(("isDelegatedAdmin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "thumbnail-photo-etag" => Some(("thumbnailPhotoEtag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "suspended" => Some(("suspended", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "aliases" => Some(("aliases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -4412,7 +4461,7 @@ impl<'n, 'a> Engine<'n, 'a> { "change-password-at-next-login" => Some(("changePasswordAtNextLogin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4465,6 +4514,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4595,6 +4645,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4734,6 +4785,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5076,7 +5128,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() @@ -5089,7 +5141,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() @@ -6836,7 +6888,7 @@ fn main() { let mut app = App::new("admin1-directory") .author("Sebastian Thiel ") - .version("0.3.0+20150314") + .version("0.3.0+20150326") .about("The Admin SDK Directory API lets you view and manage enterprise resources such as users and groups, administrative notifications, security features, and more.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_admin1_directory_cli") .arg(Arg::with_name("url") diff --git a/gen/admin1_directory/Cargo.toml b/gen/admin1_directory/Cargo.toml index 2ba6240b2b..e63079d04f 100644 --- a/gen/admin1_directory/Cargo.toml +++ b/gen/admin1_directory/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin1_directory" -version = "0.1.8+20150314" +version = "0.1.8+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with directory (protocol directory_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_directory" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/admin1_directory/README.md b/gen/admin1_directory/README.md index 1fdd94d0d0..50fe4540ac 100644 --- a/gen/admin1_directory/README.md +++ b/gen/admin1_directory/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-admin1_directory` library allows access to all features of the *Google directory* service. -This documentation was generated from *directory* crate version *0.1.8+20150314*, where *20150314* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *directory* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *directory* *v1_directory* API can be found at the [official documentation site](https://developers.google.com/admin-sdk/directory/). diff --git a/gen/admin1_directory/src/cmn.rs b/gen/admin1_directory/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/admin1_directory/src/cmn.rs +++ b/gen/admin1_directory/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/admin1_directory/src/lib.rs b/gen/admin1_directory/src/lib.rs index e36d11bb1f..d1f4e66b1a 100644 --- a/gen/admin1_directory/src/lib.rs +++ b/gen/admin1_directory/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *directory* crate version *0.1.8+20150314*, where *20150314* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *directory* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *directory* *v1_directory* API can be found at the //! [official documentation site](https://developers.google.com/admin-sdk/directory/). diff --git a/gen/admin1_directory/src/lib.rs.in b/gen/admin1_directory/src/lib.rs.in index a709fd4d17..650848901a 100644 --- a/gen/admin1_directory/src/lib.rs.in +++ b/gen/admin1_directory/src/lib.rs.in @@ -825,6 +825,9 @@ pub struct User { /// Boolean indicating if the user is delegated admin (Read-only) #[serde(rename="isDelegatedAdmin")] pub is_delegated_admin: Option, + /// ETag of the user's photo (Read-only) + #[serde(rename="thumbnailPhotoEtag")] + pub thumbnail_photo_etag: Option, /// Indicates if user is suspended pub suspended: Option, /// Unique identifier of User (Read-only) diff --git a/gen/admin1_reports-cli/Cargo.toml b/gen/admin1_reports-cli/Cargo.toml index 5d3f44a8a3..0326319f8f 100644 --- a/gen/admin1_reports-cli/Cargo.toml +++ b/gen/admin1_reports-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin1_reports-cli" -version = "0.3.0+20150115" +version = "0.3.0+20150429" authors = ["Sebastian Thiel "] description = "A complete library to interact with reports (protocol reports_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_reports-cli" @@ -17,8 +17,8 @@ keywords = ["admin", "google", "cli"] name = "admin1-reports" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/admin1_reports-cli/README.md b/gen/admin1_reports-cli/README.md index 89c1e33e02..b91584b980 100644 --- a/gen/admin1_reports-cli/README.md +++ b/gen/admin1_reports-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *reports* API at revision *20150115*. The CLI is at version *0.3.0*. +This documentation was generated from the *reports* API at revision *20150429*. The CLI is at version *0.3.0*. ```bash admin1-reports [options] diff --git a/gen/admin1_reports-cli/mkdocs.yml b/gen/admin1_reports-cli/mkdocs.yml index b94df424c2..585f8a244a 100644 --- a/gen/admin1_reports-cli/mkdocs.yml +++ b/gen/admin1_reports-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: reports v0.3.0+20150115 +site_name: reports v0.3.0+20150429 site_url: http://byron.github.io/google-apis-rs/google-admin1_reports-cli site_description: Write integrating applications with bcore diff --git a/gen/admin1_reports-cli/src/main.rs b/gen/admin1_reports-cli/src/main.rs index d133f55603..ea28588851 100644 --- a/gen/admin1_reports-cli/src/main.rs +++ b/gen/admin1_reports-cli/src/main.rs @@ -114,6 +114,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -232,6 +233,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -379,6 +381,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -446,6 +449,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -538,7 +542,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() @@ -551,7 +555,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() @@ -730,7 +734,7 @@ fn main() { let mut app = App::new("admin1-reports") .author("Sebastian Thiel ") - .version("0.3.0+20150115") + .version("0.3.0+20150429") .about("Allows the administrators of Google Apps customers to fetch reports about the usage, collaboration, security and risk for their users.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_admin1_reports_cli") .arg(Arg::with_name("url") diff --git a/gen/admin1_reports/Cargo.toml b/gen/admin1_reports/Cargo.toml index 819f4a002b..9d0c137d44 100644 --- a/gen/admin1_reports/Cargo.toml +++ b/gen/admin1_reports/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin1_reports" -version = "0.1.8+20150115" +version = "0.1.8+20150429" authors = ["Sebastian Thiel "] description = "A complete library to interact with reports (protocol reports_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_reports" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/admin1_reports/README.md b/gen/admin1_reports/README.md index 5e762dffbb..811fd9a576 100644 --- a/gen/admin1_reports/README.md +++ b/gen/admin1_reports/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-admin1_reports` library allows access to all features of the *Google reports* service. -This documentation was generated from *reports* crate version *0.1.8+20150115*, where *20150115* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *reports* crate version *0.1.8+20150429*, where *20150429* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *reports* *v1_reports* API can be found at the [official documentation site](https://developers.google.com/admin-sdk/reports/). diff --git a/gen/admin1_reports/src/cmn.rs b/gen/admin1_reports/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/admin1_reports/src/cmn.rs +++ b/gen/admin1_reports/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/admin1_reports/src/lib.rs b/gen/admin1_reports/src/lib.rs index 326a9def6f..a81e795401 100644 --- a/gen/admin1_reports/src/lib.rs +++ b/gen/admin1_reports/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *reports* crate version *0.1.8+20150115*, where *20150115* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *reports* crate version *0.1.8+20150429*, where *20150429* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *reports* *v1_reports* API can be found at the //! [official documentation site](https://developers.google.com/admin-sdk/reports/). diff --git a/gen/admin2_email_migration-cli/Cargo.toml b/gen/admin2_email_migration-cli/Cargo.toml index fd0c6a0fa7..c6b79bf946 100644 --- a/gen/admin2_email_migration-cli/Cargo.toml +++ b/gen/admin2_email_migration-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["admin", "google", "cli"] name = "admin2-email-migration" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/admin2_email_migration-cli/src/main.rs b/gen/admin2_email_migration-cli/src/main.rs index f84ff291f2..bb81eb46e4 100644 --- a/gen/admin2_email_migration-cli/src/main.rs +++ b/gen/admin2_email_migration-cli/src/main.rs @@ -183,7 +183,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() @@ -196,7 +196,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() diff --git a/gen/admin2_email_migration/Cargo.toml b/gen/admin2_email_migration/Cargo.toml index 6010568e3c..853a7c2f0b 100644 --- a/gen/admin2_email_migration/Cargo.toml +++ b/gen/admin2_email_migration/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/admin2_email_migration/src/cmn.rs b/gen/admin2_email_migration/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/admin2_email_migration/src/cmn.rs +++ b/gen/admin2_email_migration/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/adsense1d4-cli/Cargo.toml b/gen/adsense1d4-cli/Cargo.toml index 27d76d360e..5f3bcd66d6 100644 --- a/gen/adsense1d4-cli/Cargo.toml +++ b/gen/adsense1d4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsense1d4-cli" -version = "0.3.0+20150326" +version = "0.3.0+20150617" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense (protocol v1.4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsense1d4-cli" @@ -17,8 +17,8 @@ keywords = ["adsense", "google", "cli"] name = "adsense1d4" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/adsense1d4-cli/README.md b/gen/adsense1d4-cli/README.md index 4bb2012da6..0d2aae5f9d 100644 --- a/gen/adsense1d4-cli/README.md +++ b/gen/adsense1d4-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *AdSense* API at revision *20150326*. The CLI is at version *0.3.0*. +This documentation was generated from the *AdSense* API at revision *20150617*. The CLI is at version *0.3.0*. ```bash adsense1d4 [options] diff --git a/gen/adsense1d4-cli/mkdocs.yml b/gen/adsense1d4-cli/mkdocs.yml index 47df9de147..db7c6bfc09 100644 --- a/gen/adsense1d4-cli/mkdocs.yml +++ b/gen/adsense1d4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AdSense v0.3.0+20150326 +site_name: AdSense v0.3.0+20150617 site_url: http://byron.github.io/google-apis-rs/google-adsense1d4-cli site_description: Write integrating applications with bcore diff --git a/gen/adsense1d4-cli/src/main.rs b/gen/adsense1d4-cli/src/main.rs index 01fa24118b..b63d6b4313 100644 --- a/gen/adsense1d4-cli/src/main.rs +++ b/gen/adsense1d4-cli/src/main.rs @@ -96,6 +96,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -154,6 +155,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -205,6 +207,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -256,6 +259,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -317,6 +321,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -416,6 +421,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -477,6 +483,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -528,6 +535,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -586,6 +594,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -641,6 +650,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -699,6 +709,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -750,6 +761,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -834,8 +846,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -898,6 +912,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -956,6 +971,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1007,6 +1023,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1065,6 +1082,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1123,6 +1141,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1181,6 +1200,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1239,6 +1259,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1290,6 +1311,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1341,6 +1363,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1402,6 +1425,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1501,6 +1525,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1562,6 +1587,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1613,6 +1639,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1671,6 +1698,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1722,6 +1750,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1773,6 +1802,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1824,6 +1854,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1911,8 +1942,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -1975,6 +2008,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2033,6 +2067,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2084,6 +2119,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2142,6 +2178,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2200,6 +2237,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2439,7 +2477,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() @@ -2452,7 +2490,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() @@ -3441,7 +3479,7 @@ fn main() { let mut app = App::new("adsense1d4") .author("Sebastian Thiel ") - .version("0.3.0+20150326") + .version("0.3.0+20150617") .about("Gives AdSense publishers access to their inventory and the ability to generate reports") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adsense1d4_cli") .arg(Arg::with_name("url") diff --git a/gen/adsense1d4/Cargo.toml b/gen/adsense1d4/Cargo.toml index 97edf07073..8a5ed0a22f 100644 --- a/gen/adsense1d4/Cargo.toml +++ b/gen/adsense1d4/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsense1d4" -version = "0.1.8+20150326" +version = "0.1.8+20150617" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense (protocol v1.4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsense1d4" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/adsense1d4/README.md b/gen/adsense1d4/README.md index e43d8f6422..c71ab98bae 100644 --- a/gen/adsense1d4/README.md +++ b/gen/adsense1d4/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-adsense1d4` library allows access to all features of the *Google AdSense* service. -This documentation was generated from *AdSense* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *AdSense* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *AdSense* *v1d4* API can be found at the [official documentation site](https://developers.google.com/adsense/management/). diff --git a/gen/adsense1d4/src/cmn.rs b/gen/adsense1d4/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/adsense1d4/src/cmn.rs +++ b/gen/adsense1d4/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/adsense1d4/src/lib.rs b/gen/adsense1d4/src/lib.rs index b46933dae9..22b9dc0d61 100644 --- a/gen/adsense1d4/src/lib.rs +++ b/gen/adsense1d4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *AdSense* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *AdSense* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *AdSense* *v1d4* API can be found at the //! [official documentation site](https://developers.google.com/adsense/management/). diff --git a/gen/adsensehost4d1-cli/Cargo.toml b/gen/adsensehost4d1-cli/Cargo.toml index 76fca1263f..e4229b3306 100644 --- a/gen/adsensehost4d1-cli/Cargo.toml +++ b/gen/adsensehost4d1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsensehost4d1-cli" -version = "0.3.0+20150307" +version = "0.3.0+20150617" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense Host (protocol v4.1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsensehost4d1-cli" @@ -17,8 +17,8 @@ keywords = ["adsensehost", "google", "cli"] name = "adsensehost4d1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/adsensehost4d1-cli/README.md b/gen/adsensehost4d1-cli/README.md index 8a22bc8b86..6230d2ceb7 100644 --- a/gen/adsensehost4d1-cli/README.md +++ b/gen/adsensehost4d1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *AdSense Host* API at revision *20150307*. The CLI is at version *0.3.0*. +This documentation was generated from the *AdSense Host* API at revision *20150617*. The CLI is at version *0.3.0*. ```bash adsensehost4d1 [options] diff --git a/gen/adsensehost4d1-cli/mkdocs.yml b/gen/adsensehost4d1-cli/mkdocs.yml index 0b96a73629..b324d7965d 100644 --- a/gen/adsensehost4d1-cli/mkdocs.yml +++ b/gen/adsensehost4d1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AdSense Host v0.3.0+20150307 +site_name: AdSense Host v0.3.0+20150617 site_url: http://byron.github.io/google-apis-rs/google-adsensehost4d1-cli site_description: Write integrating applications with bcore diff --git a/gen/adsensehost4d1-cli/src/main.rs b/gen/adsensehost4d1-cli/src/main.rs index c11b430f6f..3da3ac999e 100644 --- a/gen/adsensehost4d1-cli/src/main.rs +++ b/gen/adsensehost4d1-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -147,6 +148,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -198,6 +200,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -249,6 +252,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -304,6 +308,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -410,6 +415,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -471,6 +477,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -577,6 +584,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -683,6 +691,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -734,6 +743,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -785,6 +795,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -858,6 +869,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -909,6 +921,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -967,6 +980,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1025,6 +1039,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1076,6 +1091,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1127,6 +1143,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1178,6 +1195,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1265,6 +1283,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1323,6 +1342,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1410,6 +1430,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1497,6 +1518,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1570,6 +1592,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1621,6 +1644,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1707,6 +1731,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1765,6 +1790,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1936,7 +1962,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() @@ -1949,7 +1975,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() @@ -2734,7 +2760,7 @@ fn main() { let mut app = App::new("adsensehost4d1") .author("Sebastian Thiel ") - .version("0.3.0+20150307") + .version("0.3.0+20150617") .about("Gives AdSense Hosts access to report generation, ad code generation, and publisher management capabilities.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adsensehost4d1_cli") .arg(Arg::with_name("url") diff --git a/gen/adsensehost4d1/Cargo.toml b/gen/adsensehost4d1/Cargo.toml index 3f9de7b385..42d7eedb55 100644 --- a/gen/adsensehost4d1/Cargo.toml +++ b/gen/adsensehost4d1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsensehost4d1" -version = "0.1.8+20150307" +version = "0.1.8+20150617" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense Host (protocol v4.1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsensehost4d1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/adsensehost4d1/README.md b/gen/adsensehost4d1/README.md index 579f836415..9e06376dde 100644 --- a/gen/adsensehost4d1/README.md +++ b/gen/adsensehost4d1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-adsensehost4d1` library allows access to all features of the *Google AdSense Host* service. -This documentation was generated from *AdSense Host* crate version *0.1.8+20150307*, where *20150307* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *AdSense Host* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *AdSense Host* *v4d1* API can be found at the [official documentation site](https://developers.google.com/adsense/host/). diff --git a/gen/adsensehost4d1/src/cmn.rs b/gen/adsensehost4d1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/adsensehost4d1/src/cmn.rs +++ b/gen/adsensehost4d1/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/adsensehost4d1/src/lib.rs b/gen/adsensehost4d1/src/lib.rs index 98ff84e908..4338415f4d 100644 --- a/gen/adsensehost4d1/src/lib.rs +++ b/gen/adsensehost4d1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *AdSense Host* crate version *0.1.8+20150307*, where *20150307* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *AdSense Host* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *AdSense Host* *v4d1* API can be found at the //! [official documentation site](https://developers.google.com/adsense/host/). diff --git a/gen/analytics3-cli/Cargo.toml b/gen/analytics3-cli/Cargo.toml index 266cb7f84d..5981a97272 100644 --- a/gen/analytics3-cli/Cargo.toml +++ b/gen/analytics3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-analytics3-cli" -version = "0.3.0+20150305" +version = "0.3.0+20150417" authors = ["Sebastian Thiel "] description = "A complete library to interact with analytics (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/analytics3-cli" @@ -17,8 +17,8 @@ keywords = ["analytics", "google", "cli"] name = "analytics3" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/analytics3-cli/README.md b/gen/analytics3-cli/README.md index b4d2f4a0c9..a5e0882fa7 100644 --- a/gen/analytics3-cli/README.md +++ b/gen/analytics3-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *analytics* API at revision *20150305*. The CLI is at version *0.3.0*. +This documentation was generated from the *analytics* API at revision *20150417*. The CLI is at version *0.3.0*. ```bash analytics3 [options] diff --git a/gen/analytics3-cli/mkdocs.yml b/gen/analytics3-cli/mkdocs.yml index d335e151ac..99cdc5b377 100644 --- a/gen/analytics3-cli/mkdocs.yml +++ b/gen/analytics3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: analytics v0.3.0+20150305 +site_name: analytics v0.3.0+20150417 site_url: http://byron.github.io/google-apis-rs/google-analytics3-cli site_description: Write integrating applications with bcore diff --git a/gen/analytics3-cli/src/main.rs b/gen/analytics3-cli/src/main.rs index e26c00fceb..c646f2b2c3 100644 --- a/gen/analytics3-cli/src/main.rs +++ b/gen/analytics3-cli/src/main.rs @@ -114,6 +114,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -184,6 +185,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -248,6 +250,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -306,6 +309,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -458,6 +462,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -516,6 +521,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -624,6 +630,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -682,6 +689,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -740,6 +748,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -791,6 +800,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -887,6 +897,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -945,6 +956,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1045,6 +1057,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1145,6 +1158,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1196,6 +1210,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1295,6 +1310,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1353,6 +1369,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1456,6 +1473,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1559,6 +1577,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1654,6 +1673,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1765,6 +1785,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1823,6 +1844,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1934,6 +1956,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2045,6 +2068,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2096,6 +2120,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2147,6 +2172,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2180,32 +2206,40 @@ impl<'n, 'a> Engine<'n, 'a> { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created" => Some(("created", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "uppercase-details.field" => Some(("uppercaseDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uppercase-details.field-index" => Some(("uppercaseDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "updated" => Some(("updated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advanced-details.field-b-index" => Some(("advancedDetails.fieldBIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "advanced-details.extract-b" => Some(("advancedDetails.extractB", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advanced-details.output-to-field-index" => Some(("advancedDetails.outputToFieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "advanced-details.override-output-field" => Some(("advancedDetails.overrideOutputField", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "advanced-details.field-a-required" => Some(("advancedDetails.fieldARequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "advanced-details.output-constructor" => Some(("advancedDetails.outputConstructor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advanced-details.field-b-required" => Some(("advancedDetails.fieldBRequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "advanced-details.case-sensitive" => Some(("advancedDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advanced-details.field-a-index" => Some(("advancedDetails.fieldAIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "advanced-details.field-b" => Some(("advancedDetails.fieldB", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advanced-details.field-a" => Some(("advancedDetails.fieldA", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advanced-details.extract-a" => Some(("advancedDetails.extractA", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advanced-details.output-to-field" => Some(("advancedDetails.outputToField", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lowercase-details.field" => Some(("lowercaseDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lowercase-details.field-index" => Some(("lowercaseDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "search-and-replace-details.case-sensitive" => Some(("searchAndReplaceDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "search-and-replace-details.field-index" => Some(("searchAndReplaceDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "search-and-replace-details.search-string" => Some(("searchAndReplaceDetails.searchString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "search-and-replace-details.replace-string" => Some(("searchAndReplaceDetails.replaceString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "search-and-replace-details.field" => Some(("searchAndReplaceDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "exclude-details.case-sensitive" => Some(("excludeDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "exclude-details.kind" => Some(("excludeDetails.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "exclude-details.match-type" => Some(("excludeDetails.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "exclude-details.expression-value" => Some(("excludeDetails.expressionValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "exclude-details.field" => Some(("excludeDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "include-details.case-sensitive" => Some(("includeDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "exclude-details.case-sensitive" => Some(("excludeDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "exclude-details.field-index" => Some(("excludeDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "exclude-details.match-type" => Some(("excludeDetails.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-details.kind" => Some(("includeDetails.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "include-details.match-type" => Some(("includeDetails.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-details.expression-value" => Some(("includeDetails.expressionValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-details.field" => Some(("includeDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "include-details.case-sensitive" => Some(("includeDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "include-details.field-index" => Some(("includeDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "include-details.match-type" => Some(("includeDetails.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent-link.href" => Some(("parentLink.href", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent-link.type" => Some(("parentLink.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2213,7 +2247,7 @@ impl<'n, 'a> Engine<'n, 'a> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "advanced-details", "case-sensitive", "created", "exclude-details", "expression-value", "extract-a", "extract-b", "field", "field-a", "field-a-required", "field-b", "field-b-required", "href", "id", "include-details", "kind", "lowercase-details", "match-type", "name", "output-constructor", "output-to-field", "override-output-field", "parent-link", "replace-string", "search-and-replace-details", "search-string", "self-link", "type", "updated", "uppercase-details"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "advanced-details", "case-sensitive", "created", "exclude-details", "expression-value", "extract-a", "extract-b", "field", "field-a", "field-a-index", "field-a-required", "field-b", "field-b-index", "field-b-required", "field-index", "href", "id", "include-details", "kind", "lowercase-details", "match-type", "name", "output-constructor", "output-to-field", "output-to-field-index", "override-output-field", "parent-link", "replace-string", "search-and-replace-details", "search-string", "self-link", "type", "updated", "uppercase-details"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2266,6 +2300,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2324,6 +2359,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2357,32 +2393,40 @@ impl<'n, 'a> Engine<'n, 'a> { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created" => Some(("created", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "uppercase-details.field" => Some(("uppercaseDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uppercase-details.field-index" => Some(("uppercaseDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "updated" => Some(("updated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advanced-details.field-b-index" => Some(("advancedDetails.fieldBIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "advanced-details.extract-b" => Some(("advancedDetails.extractB", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advanced-details.output-to-field-index" => Some(("advancedDetails.outputToFieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "advanced-details.override-output-field" => Some(("advancedDetails.overrideOutputField", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "advanced-details.field-a-required" => Some(("advancedDetails.fieldARequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "advanced-details.output-constructor" => Some(("advancedDetails.outputConstructor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advanced-details.field-b-required" => Some(("advancedDetails.fieldBRequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "advanced-details.case-sensitive" => Some(("advancedDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advanced-details.field-a-index" => Some(("advancedDetails.fieldAIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "advanced-details.field-b" => Some(("advancedDetails.fieldB", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advanced-details.field-a" => Some(("advancedDetails.fieldA", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advanced-details.extract-a" => Some(("advancedDetails.extractA", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advanced-details.output-to-field" => Some(("advancedDetails.outputToField", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lowercase-details.field" => Some(("lowercaseDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lowercase-details.field-index" => Some(("lowercaseDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "search-and-replace-details.case-sensitive" => Some(("searchAndReplaceDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "search-and-replace-details.field-index" => Some(("searchAndReplaceDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "search-and-replace-details.search-string" => Some(("searchAndReplaceDetails.searchString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "search-and-replace-details.replace-string" => Some(("searchAndReplaceDetails.replaceString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "search-and-replace-details.field" => Some(("searchAndReplaceDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "exclude-details.case-sensitive" => Some(("excludeDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "exclude-details.kind" => Some(("excludeDetails.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "exclude-details.match-type" => Some(("excludeDetails.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "exclude-details.expression-value" => Some(("excludeDetails.expressionValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "exclude-details.field" => Some(("excludeDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "include-details.case-sensitive" => Some(("includeDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "exclude-details.case-sensitive" => Some(("excludeDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "exclude-details.field-index" => Some(("excludeDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "exclude-details.match-type" => Some(("excludeDetails.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-details.kind" => Some(("includeDetails.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "include-details.match-type" => Some(("includeDetails.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-details.expression-value" => Some(("includeDetails.expressionValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-details.field" => Some(("includeDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "include-details.case-sensitive" => Some(("includeDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "include-details.field-index" => Some(("includeDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "include-details.match-type" => Some(("includeDetails.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent-link.href" => Some(("parentLink.href", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent-link.type" => Some(("parentLink.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2390,7 +2434,7 @@ impl<'n, 'a> Engine<'n, 'a> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "advanced-details", "case-sensitive", "created", "exclude-details", "expression-value", "extract-a", "extract-b", "field", "field-a", "field-a-required", "field-b", "field-b-required", "href", "id", "include-details", "kind", "lowercase-details", "match-type", "name", "output-constructor", "output-to-field", "override-output-field", "parent-link", "replace-string", "search-and-replace-details", "search-string", "self-link", "type", "updated", "uppercase-details"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "advanced-details", "case-sensitive", "created", "exclude-details", "expression-value", "extract-a", "extract-b", "field", "field-a", "field-a-index", "field-a-required", "field-b", "field-b-index", "field-b-required", "field-index", "href", "id", "include-details", "kind", "lowercase-details", "match-type", "name", "output-constructor", "output-to-field", "output-to-field-index", "override-output-field", "parent-link", "replace-string", "search-and-replace-details", "search-string", "self-link", "type", "updated", "uppercase-details"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2443,6 +2487,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2476,32 +2521,40 @@ impl<'n, 'a> Engine<'n, 'a> { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created" => Some(("created", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "uppercase-details.field" => Some(("uppercaseDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "uppercase-details.field-index" => Some(("uppercaseDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "updated" => Some(("updated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advanced-details.field-b-index" => Some(("advancedDetails.fieldBIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "advanced-details.extract-b" => Some(("advancedDetails.extractB", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advanced-details.output-to-field-index" => Some(("advancedDetails.outputToFieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "advanced-details.override-output-field" => Some(("advancedDetails.overrideOutputField", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "advanced-details.field-a-required" => Some(("advancedDetails.fieldARequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "advanced-details.output-constructor" => Some(("advancedDetails.outputConstructor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advanced-details.field-b-required" => Some(("advancedDetails.fieldBRequired", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "advanced-details.case-sensitive" => Some(("advancedDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advanced-details.field-a-index" => Some(("advancedDetails.fieldAIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "advanced-details.field-b" => Some(("advancedDetails.fieldB", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advanced-details.field-a" => Some(("advancedDetails.fieldA", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advanced-details.extract-a" => Some(("advancedDetails.extractA", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "advanced-details.output-to-field" => Some(("advancedDetails.outputToField", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lowercase-details.field" => Some(("lowercaseDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lowercase-details.field-index" => Some(("lowercaseDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "search-and-replace-details.case-sensitive" => Some(("searchAndReplaceDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "search-and-replace-details.field-index" => Some(("searchAndReplaceDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "search-and-replace-details.search-string" => Some(("searchAndReplaceDetails.searchString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "search-and-replace-details.replace-string" => Some(("searchAndReplaceDetails.replaceString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "search-and-replace-details.field" => Some(("searchAndReplaceDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "exclude-details.case-sensitive" => Some(("excludeDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "exclude-details.kind" => Some(("excludeDetails.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "exclude-details.match-type" => Some(("excludeDetails.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "exclude-details.expression-value" => Some(("excludeDetails.expressionValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "exclude-details.field" => Some(("excludeDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "include-details.case-sensitive" => Some(("includeDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "exclude-details.case-sensitive" => Some(("excludeDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "exclude-details.field-index" => Some(("excludeDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "exclude-details.match-type" => Some(("excludeDetails.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-details.kind" => Some(("includeDetails.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "include-details.match-type" => Some(("includeDetails.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-details.expression-value" => Some(("includeDetails.expressionValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-details.field" => Some(("includeDetails.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "include-details.case-sensitive" => Some(("includeDetails.caseSensitive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "include-details.field-index" => Some(("includeDetails.fieldIndex", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "include-details.match-type" => Some(("includeDetails.matchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent-link.href" => Some(("parentLink.href", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent-link.type" => Some(("parentLink.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2509,7 +2562,7 @@ impl<'n, 'a> Engine<'n, 'a> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "advanced-details", "case-sensitive", "created", "exclude-details", "expression-value", "extract-a", "extract-b", "field", "field-a", "field-a-required", "field-b", "field-b-required", "href", "id", "include-details", "kind", "lowercase-details", "match-type", "name", "output-constructor", "output-to-field", "override-output-field", "parent-link", "replace-string", "search-and-replace-details", "search-string", "self-link", "type", "updated", "uppercase-details"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "advanced-details", "case-sensitive", "created", "exclude-details", "expression-value", "extract-a", "extract-b", "field", "field-a", "field-a-index", "field-a-required", "field-b", "field-b-index", "field-b-required", "field-index", "href", "id", "include-details", "kind", "lowercase-details", "match-type", "name", "output-constructor", "output-to-field", "output-to-field-index", "override-output-field", "parent-link", "replace-string", "search-and-replace-details", "search-string", "self-link", "type", "updated", "uppercase-details"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2562,6 +2615,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2613,6 +2667,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2720,6 +2775,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2778,6 +2834,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2885,6 +2942,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2992,6 +3050,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3087,6 +3146,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3186,6 +3246,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3244,6 +3305,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3343,6 +3405,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3442,6 +3505,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3594,6 +3658,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3652,6 +3717,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3760,6 +3826,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3855,6 +3922,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3964,6 +4032,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4022,6 +4091,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4131,6 +4201,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4240,6 +4311,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4298,6 +4370,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4349,6 +4422,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4452,6 +4526,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4510,6 +4585,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4638,6 +4714,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4696,6 +4773,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4751,6 +4829,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4846,6 +4925,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4940,6 +5020,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4998,6 +5079,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5092,6 +5174,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5186,6 +5269,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5237,6 +5321,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5338,6 +5423,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5396,6 +5482,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5497,6 +5584,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5598,6 +5686,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5750,6 +5839,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5808,6 +5898,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5916,6 +6007,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5967,6 +6059,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6106,6 +6199,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6417,7 +6511,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() @@ -6430,7 +6524,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() @@ -9128,7 +9222,7 @@ fn main() { let mut app = App::new("analytics3") .author("Sebastian Thiel ") - .version("0.3.0+20150305") + .version("0.3.0+20150417") .about("View and manage your Google Analytics data") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_analytics3_cli") .arg(Arg::with_name("url") diff --git a/gen/analytics3/Cargo.toml b/gen/analytics3/Cargo.toml index 215c8a88af..55789da1ac 100644 --- a/gen/analytics3/Cargo.toml +++ b/gen/analytics3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-analytics3" -version = "0.1.8+20150305" +version = "0.1.8+20150417" authors = ["Sebastian Thiel "] description = "A complete library to interact with analytics (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/analytics3" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/analytics3/README.md b/gen/analytics3/README.md index 9541611464..2cec71b86f 100644 --- a/gen/analytics3/README.md +++ b/gen/analytics3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-analytics3` library allows access to all features of the *Google analytics* service. -This documentation was generated from *analytics* crate version *0.1.8+20150305*, where *20150305* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *analytics* crate version *0.1.8+20150417*, where *20150417* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *analytics* *v3* API can be found at the [official documentation site](https://developers.google.com/analytics/). diff --git a/gen/analytics3/src/cmn.rs b/gen/analytics3/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/analytics3/src/cmn.rs +++ b/gen/analytics3/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/analytics3/src/lib.rs b/gen/analytics3/src/lib.rs index 2dcd5ecc8f..e32828b830 100644 --- a/gen/analytics3/src/lib.rs +++ b/gen/analytics3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *analytics* crate version *0.1.8+20150305*, where *20150305* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *analytics* crate version *0.1.8+20150417*, where *20150417* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *analytics* *v3* API can be found at the //! [official documentation site](https://developers.google.com/analytics/). diff --git a/gen/analytics3/src/lib.rs.in b/gen/analytics3/src/lib.rs.in index f73d0ba0fc..923fae41ac 100644 --- a/gen/analytics3/src/lib.rs.in +++ b/gen/analytics3/src/lib.rs.in @@ -857,9 +857,15 @@ impl ResponseResult for Accounts {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct FilterAdvancedDetails { + /// The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. + #[serde(rename="fieldBIndex")] + pub field_b_index: Option, /// Field A. #[serde(rename="fieldA")] pub field_a: Option, + /// The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. + #[serde(rename="outputToFieldIndex")] + pub output_to_field_index: Option, /// Indicates if the existing value of the output field, if any, should be overridden by the output expression. #[serde(rename="overrideOutputField")] pub override_output_field: Option, @@ -875,6 +881,9 @@ pub struct FilterAdvancedDetails { /// Indicates if the filter expressions are case sensitive. #[serde(rename="caseSensitive")] pub case_sensitive: Option, + /// The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. + #[serde(rename="fieldAIndex")] + pub field_a_index: Option, /// Field B. #[serde(rename="fieldB")] pub field_b: Option, @@ -1530,6 +1539,9 @@ pub struct FilterSearchAndReplaceDetails { /// Determines if the filter is case sensitive. #[serde(rename="caseSensitive")] pub case_sensitive: Option, + /// The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. + #[serde(rename="fieldIndex")] + pub field_index: Option, /// Term to search. #[serde(rename="searchString")] pub search_string: Option, @@ -1757,9 +1769,6 @@ pub struct FilterExpression { pub case_sensitive: Option, /// Kind value for filter expression pub kind: Option, - /// Match type for this filter. Possible values are BEGINS_WITH, EQUAL, ENDS_WITH, CONTAINS, MATCHES. Include and Exclude filters can use any match type. Match type is not applicable to Upper case and Lower case filters. Search and Replace expressions in the Search and Replace filter and all filter expressions in the Advanced filter default to MATCHES. User should not set match type for those filters. - #[serde(rename="matchType")] - pub match_type: Option, /// Filter expression value #[serde(rename="expressionValue")] pub expression_value: Option, @@ -1847,8 +1856,16 @@ pub struct FilterExpression { /// - Social /// - SOCIAL_NETWORK, /// - SOCIAL_ACTION, - /// - SOCIAL_ACTION_TARGET, + /// - SOCIAL_ACTION_TARGET, + /// - Custom dimension + /// - CUSTOM_DIMENSION (See accompanying field index), pub field: Option, + /// Match type for this filter. Possible values are BEGINS_WITH, EQUAL, ENDS_WITH, CONTAINS, MATCHES. Include and Exclude filters can use any match type. Match type is not applicable to Upper case and Lower case filters. Search and Replace expressions in the Search and Replace filter and all filter expressions in the Advanced filter default to MATCHES. User should not set match type for those filters. + #[serde(rename="matchType")] + pub match_type: Option, + /// The Index of the custom dimension. Set only if the field is a is CUSTOM_DIMENSION. + #[serde(rename="fieldIndex")] + pub field_index: Option, } impl Part for FilterExpression {} @@ -2156,6 +2173,9 @@ impl ResponseResult for Uploads {} pub struct FilterLowercaseDetails { /// Field to use in the filter. pub field: Option, + /// The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. + #[serde(rename="fieldIndex")] + pub field_index: Option, } impl NestedType for FilterLowercaseDetails {} @@ -2434,6 +2454,9 @@ impl Part for AccountChildLink {} pub struct FilterUppercaseDetails { /// Field to use in the filter. pub field: Option, + /// The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. + #[serde(rename="fieldIndex")] + pub field_index: Option, } impl NestedType for FilterUppercaseDetails {} diff --git a/gen/androidenterprise1-cli/Cargo.toml b/gen/androidenterprise1-cli/Cargo.toml index fdf14ed5fc..b6fc2ff9f2 100644 --- a/gen/androidenterprise1-cli/Cargo.toml +++ b/gen/androidenterprise1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androidenterprise1-cli" -version = "0.3.0+20150309" +version = "0.3.0+20150303" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Enterprise (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidenterprise1-cli" @@ -16,8 +16,8 @@ keywords = ["androidenterprise", "google", "cli"] name = "androidenterprise1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/androidenterprise1-cli/README.md b/gen/androidenterprise1-cli/README.md index ef66d4a6b1..70b6a2708a 100644 --- a/gen/androidenterprise1-cli/README.md +++ b/gen/androidenterprise1-cli/README.md @@ -21,7 +21,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Android Enterprise* API at revision *20150309*. The CLI is at version *0.3.0*. +This documentation was generated from the *Android Enterprise* API at revision *20150303*. The CLI is at version *0.3.0*. ```bash androidenterprise1 [options] @@ -71,6 +71,8 @@ androidenterprise1 [options] permissions get [-p ]... [-o ] products + approve (-r )... [-p ]... + generate-approval-url [-p ]... [-o ] get [-p ]... [-o ] get-app-restrictions-schema [-p ]... [-o ] get-permissions [-p ]... [-o ] diff --git a/gen/androidenterprise1-cli/mkdocs.yml b/gen/androidenterprise1-cli/mkdocs.yml index b72dd6d259..966dabe78a 100644 --- a/gen/androidenterprise1-cli/mkdocs.yml +++ b/gen/androidenterprise1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Enterprise v0.3.0+20150309 +site_name: Android Enterprise v0.3.0+20150303 site_url: http://byron.github.io/google-apis-rs/google-androidenterprise1-cli site_description: Write integrating applications with bcore @@ -45,6 +45,8 @@ pages: - ['installs_patch.md', 'Installs', 'Patch'] - ['installs_update.md', 'Installs', 'Update'] - ['permissions_get.md', 'Permissions', 'Get'] +- ['products_approve.md', 'Products', 'Approve'] +- ['products_generate-approval-url.md', 'Products', 'Generate Approval Url'] - ['products_get.md', 'Products', 'Get'] - ['products_get-app-restrictions-schema.md', 'Products', 'Get App Restrictions Schema'] - ['products_get-permissions.md', 'Products', 'Get Permissions'] diff --git a/gen/androidenterprise1-cli/src/main.rs b/gen/androidenterprise1-cli/src/main.rs index d5cb9f98dd..4d757d8294 100644 --- a/gen/androidenterprise1-cli/src/main.rs +++ b/gen/androidenterprise1-cli/src/main.rs @@ -133,6 +133,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -221,6 +222,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -272,6 +274,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -360,6 +363,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -448,6 +452,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -543,6 +548,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -594,6 +600,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -680,6 +687,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -766,6 +774,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -817,6 +826,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -868,6 +878,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -919,6 +930,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1004,6 +1016,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1135,6 +1148,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1186,6 +1200,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1273,6 +1288,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1324,6 +1340,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1409,6 +1426,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1548,6 +1566,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1599,6 +1618,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1689,6 +1709,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1779,6 +1800,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1830,6 +1852,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1881,6 +1904,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1932,6 +1956,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2027,6 +2052,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2078,6 +2104,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2165,6 +2192,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2252,6 +2280,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2307,6 +2336,141 @@ impl<'n, 'a> Engine<'n, 'a> { 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 _products_approve(&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()[..] { + "approval-url-info.kind" => Some(("approvalUrlInfo.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "approval-url-info.approval-url" => Some(("approvalUrlInfo.approvalUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["approval-url", "approval-url-info", "kind"]); + 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::ProductsApproveRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.products().approve(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("product-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); + } + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok(mut response) => { + Ok(()) + } + } + } + } + + fn _products_generate_approval_url(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.products().generate_approval_url(opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("product-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 { + "language-code" => { + call = call.language_code(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(["language-code"].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(()) } } @@ -2362,6 +2526,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2417,6 +2582,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2468,6 +2634,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2553,6 +2720,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2604,6 +2772,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2655,6 +2824,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2706,6 +2876,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2943,6 +3114,12 @@ impl<'n, 'a> Engine<'n, 'a> { }, ("products", Some(opt)) => { match opt.subcommand() { + ("approve", Some(opt)) => { + call_result = self._products_approve(opt, dry_run, &mut err); + }, + ("generate-approval-url", Some(opt)) => { + call_result = self._products_generate_approval_url(opt, dry_run, &mut err); + }, ("get", Some(opt)) => { call_result = self._products_get(opt, dry_run, &mut err); }, @@ -3015,7 +3192,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() @@ -3028,7 +3205,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() @@ -4194,7 +4371,63 @@ fn main() { ]), ]), - ("products", "methods: 'get', 'get-app-restrictions-schema', 'get-permissions' and 'update-permissions'", vec![ + ("products", "methods: 'approve', 'generate-approval-url', 'get', 'get-app-restrictions-schema', 'get-permissions' and 'update-permissions'", vec![ + ("approve", + Some(r##"Approves the specified product (and the relevant app permissions, if any)."##), + "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/products_approve", + vec![ + (Some(r##"enterprise-id"##), + None, + Some(r##"The ID of the enterprise."##), + Some(true), + Some(false)), + + (Some(r##"product-id"##), + None, + Some(r##"The ID of the product."##), + 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)), + ]), + ("generate-approval-url", + Some(r##"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."##), + "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/products_generate-approval-url", + vec![ + (Some(r##"enterprise-id"##), + None, + Some(r##"The ID of the enterprise."##), + Some(true), + Some(false)), + + (Some(r##"product-id"##), + None, + Some(r##"The ID of the product."##), + 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##"Retrieves details of a product for display to an enterprise admin."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/products_get", @@ -4428,7 +4661,7 @@ fn main() { let mut app = App::new("androidenterprise1") .author("Sebastian Thiel ") - .version("0.3.0+20150309") + .version("0.3.0+20150303") .about("Allows MDMs/EMMs and enterprises to manage the deployment of apps to Android for Work users.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli") .arg(Arg::with_name("url") diff --git a/gen/androidenterprise1/Cargo.toml b/gen/androidenterprise1/Cargo.toml index 250144cb1a..70046a344a 100644 --- a/gen/androidenterprise1/Cargo.toml +++ b/gen/androidenterprise1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androidenterprise1" -version = "0.1.8+20150309" +version = "0.1.8+20150303" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Enterprise (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidenterprise1" @@ -15,8 +15,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/androidenterprise1/README.md b/gen/androidenterprise1/README.md index 57f2087231..c279327d99 100644 --- a/gen/androidenterprise1/README.md +++ b/gen/androidenterprise1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-androidenterprise1` library allows access to all features of the *Google Android Enterprise* service. -This documentation was generated from *Android Enterprise* crate version *0.1.8+20150309*, where *20150309* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Android Enterprise* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. # Features Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.AndroidEnterprise.html) ... @@ -29,7 +29,7 @@ Handle the following *Resources* with ease from the central [hub](http://byron.g * [permissions](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.Permission.html) * [*get*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.PermissionGetCall.html) * [products](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.Product.html) - * [*get*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.ProductGetCall.html), [*get app restrictions schema*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.ProductGetAppRestrictionsSchemaCall.html), [*get permissions*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.ProductGetPermissionCall.html) and [*update permissions*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.ProductUpdatePermissionCall.html) + * [*approve*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.ProductApproveCall.html), [*generate approval url*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.ProductGenerateApprovalUrlCall.html), [*get*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.ProductGetCall.html), [*get app restrictions schema*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.ProductGetAppRestrictionsSchemaCall.html), [*get permissions*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.ProductGetPermissionCall.html) and [*update permissions*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.ProductUpdatePermissionCall.html) * [users](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.User.html) * [*generate token*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.UserGenerateTokenCall.html), [*get*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.UserGetCall.html), [*list*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.UserListCall.html) and [*revoke token*](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.UserRevokeTokenCall.html) diff --git a/gen/androidenterprise1/src/cmn.rs b/gen/androidenterprise1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/androidenterprise1/src/cmn.rs +++ b/gen/androidenterprise1/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/androidenterprise1/src/lib.rs b/gen/androidenterprise1/src/lib.rs index a21a3e02d9..a19a2edd6d 100644 --- a/gen/androidenterprise1/src/lib.rs +++ b/gen/androidenterprise1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Android Enterprise* crate version *0.1.8+20150309*, where *20150309* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Android Enterprise* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *androidenterprise: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/androidenterprise1). //! # Features //! @@ -27,7 +27,7 @@ //! * [permissions](struct.Permission.html) //! * [*get*](struct.PermissionGetCall.html) //! * [products](struct.Product.html) -//! * [*get*](struct.ProductGetCall.html), [*get app restrictions schema*](struct.ProductGetAppRestrictionsSchemaCall.html), [*get permissions*](struct.ProductGetPermissionCall.html) and [*update permissions*](struct.ProductUpdatePermissionCall.html) +//! * [*approve*](struct.ProductApproveCall.html), [*generate approval url*](struct.ProductGenerateApprovalUrlCall.html), [*get*](struct.ProductGetCall.html), [*get app restrictions schema*](struct.ProductGetAppRestrictionsSchemaCall.html), [*get permissions*](struct.ProductGetPermissionCall.html) and [*update permissions*](struct.ProductUpdatePermissionCall.html) //! * [users](struct.User.html) //! * [*generate token*](struct.UserGenerateTokenCall.html), [*get*](struct.UserGetCall.html), [*list*](struct.UserListCall.html) and [*revoke token*](struct.UserRevokeTokenCall.html) //! diff --git a/gen/androidenterprise1/src/lib.rs.in b/gen/androidenterprise1/src/lib.rs.in index 8240aceae0..77b78371f0 100644 --- a/gen/androidenterprise1/src/lib.rs.in +++ b/gen/androidenterprise1/src/lib.rs.in @@ -353,6 +353,60 @@ pub struct CollectionViewersListResponse { impl ResponseResult for CollectionViewersListResponse {} +/// Information on an approval URL. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApprovalUrlInfo { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#approvalUrlInfo". + pub kind: Option, + /// A URL that displays a product's permissions and that can also be used to approve the product with the Products.approve call. + #[serde(rename="approvalUrl")] + pub approval_url: Option, +} + +impl Part for ApprovalUrlInfo {} + + +/// App version represents a single APK version. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AppVersion { + /// Unique increasing identifier for the apk version. + #[serde(rename="versionCode")] + pub version_code: Option, + /// 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"). + #[serde(rename="versionString")] + pub version_string: Option, +} + +impl Part for AppVersion {} + + +/// The grouplicense resources for the enterprise. +/// +/// # 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 grouplicenses](struct.GrouplicenseListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GroupLicensesListResponse { + /// A group license for a product approved for use in the enterprise. + #[serde(rename="groupLicense")] + pub group_license: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicensesListResponse". + pub kind: Option, +} + +impl ResponseResult for GroupLicensesListResponse {} + + /// The device resources for the user. /// /// # Activities @@ -480,31 +534,6 @@ pub struct UserToken { impl ResponseResult for UserToken {} -/// Information about the permissions required by a specific app and whether they have been accepted by the enterprise. -/// -/// # 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*). -/// -/// * [update permissions products](struct.ProductUpdatePermissionCall.html) (request|response) -/// * [get permissions products](struct.ProductGetPermissionCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ProductPermissions { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productPermissions". - pub kind: Option, - /// The permissions required by the app. - pub permission: Option>, - /// The ID of the app that the permissions relate to, e.g. "app:com.google.android.gm". - #[serde(rename="productId")] - pub product_id: Option, -} - -impl RequestValue for ProductPermissions {} -impl ResponseResult for ProductPermissions {} - - /// The state of a user's device, as accessed by the getState and setState methods on device resources. /// /// # Activities @@ -555,29 +584,40 @@ impl Part for ProductPermission {} /// 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 products](struct.ProductGetCall.html) (response) -/// * [update permissions products](struct.ProductUpdatePermissionCall.html) (none) -/// * [get app restrictions schema products](struct.ProductGetAppRestrictionsSchemaCall.html) (none) /// * [get permissions products](struct.ProductGetPermissionCall.html) (none) +/// * [get products](struct.ProductGetCall.html) (response) +/// * [approve products](struct.ProductApproveCall.html) (none) +/// * [get app restrictions schema products](struct.ProductGetAppRestrictionsSchemaCall.html) (none) +/// * [generate approval url products](struct.ProductGenerateApprovalUrlCall.html) (none) +/// * [update permissions products](struct.ProductUpdatePermissionCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Product { - /// A link to an image that can be used as an icon for the product. - #[serde(rename="iconUrl")] - pub icon_url: Option, /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#product". pub kind: Option, + /// How and to whom the package is made available. + #[serde(rename="distributionChannel")] + pub distribution_channel: Option, /// The name of the product. pub title: Option, - /// A link to the (consumer) Google Play details page for the product. - #[serde(rename="detailsUrl")] - pub details_url: Option, /// A link to the Google Play for Work details page for the product, for use by an Enterprise administrator. #[serde(rename="workDetailsUrl")] pub work_details_url: Option, + /// 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. + #[serde(rename="appVersion")] + pub app_version: Option>, + /// A link to an image that can be used as an icon for the product. + #[serde(rename="iconUrl")] + pub icon_url: Option, /// The name of the author of the product (e.g. the app developer). #[serde(rename="authorName")] pub author_name: Option, + /// Whether this app can only be installed on devices using the Android for Work container app. + #[serde(rename="requiresContainerApp")] + pub requires_container_app: Option, + /// A link to the (consumer) Google Play details page for the product. + #[serde(rename="detailsUrl")] + pub details_url: Option, /// A string of the form "app: /// " - e.g. "app:com.google.android.gm" represents the GMail app. #[serde(rename="productId")] @@ -636,6 +676,26 @@ pub struct EntitlementsListResponse { impl ResponseResult for EntitlementsListResponse {} +/// The collection resources for the enterprise. +/// +/// # 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 collections](struct.CollectionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CollectionsListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collectionsListResponse". + pub kind: Option, + /// An ordered collection of products which can be made visible on the Google Play Store app to a selected group of users. + pub collection: Option>, +} + +impl ResponseResult for CollectionsListResponse {} + + /// The matching user resources. /// /// # Activities @@ -693,59 +753,66 @@ impl Resource for Collection {} impl ResponseResult for Collection {} -/// The collection resources for the enterprise. +/// 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*). /// -/// * [list collections](struct.CollectionListCall.html) (response) +/// * [approve products](struct.ProductApproveCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CollectionsListResponse { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collectionsListResponse". - pub kind: Option, - /// An ordered collection of products which can be made visible on the Google Play Store app to a selected group of users. - pub collection: Option>, +pub struct ProductsApproveRequest { + /// no description provided + #[serde(rename="approvalUrlInfo")] + pub approval_url_info: Option, } -impl ResponseResult for CollectionsListResponse {} +impl RequestValue for ProductsApproveRequest {} -/// A user resource represents an individual user within the enterprise's domain. -/// -/// Note that each user is associated with a Google account based on the user's corporate email address (which must be in one of the enterprise's domains). As part of installing an MDM app to manage a device the Google account must be provisioned to the device, and so the user resource must be created before that. This can be done using the Google Admin SDK Directory API. -/// -/// The ID for a user is an opaque string. It can be retrieved using the list method queried by the user's primary email address. +/// Information about the permissions required by a specific app and whether they have been accepted by the enterprise. /// /// # 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*). /// -/// * [revoke token users](struct.UserRevokeTokenCall.html) (none) -/// * [update collectionviewers](struct.CollectionviewerUpdateCall.html) (request|response) -/// * [patch collectionviewers](struct.CollectionviewerPatchCall.html) (request|response) -/// * [list users](struct.UserListCall.html) (none) -/// * [get collectionviewers](struct.CollectionviewerGetCall.html) (response) -/// * [generate token users](struct.UserGenerateTokenCall.html) (none) -/// * [get users](struct.UserGetCall.html) (response) +/// * [update permissions products](struct.ProductUpdatePermissionCall.html) (request|response) +/// * [get permissions products](struct.ProductGetPermissionCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct User { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#user". +pub struct ProductPermissions { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productPermissions". pub kind: Option, - /// The user's primary email, e.g. "jsmith@example.com". - #[serde(rename="primaryEmail")] - pub primary_email: Option, - /// The unique ID for the user. - pub id: Option, + /// The permissions required by the app. + pub permission: Option>, + /// The ID of the app that the permissions relate to, e.g. "app:com.google.android.gm". + #[serde(rename="productId")] + pub product_id: Option, } -impl RequestValue for User {} -impl Resource for User {} -impl ResponseResult for User {} +impl RequestValue for ProductPermissions {} +impl ResponseResult for ProductPermissions {} + + +/// 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*). +/// +/// * [generate approval url products](struct.ProductGenerateApprovalUrlCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ProductsGenerateApprovalUrlResponse { + /// 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. + pub url: Option, +} + +impl ResponseResult for ProductsGenerateApprovalUrlResponse {} /// The user resources for the group license. @@ -811,6 +878,9 @@ pub struct Device { /// The Google Play Services Android ID for the device encoded as a lowercase hex string, e.g. "123456789abcdef0". #[serde(rename="androidId")] pub android_id: Option, + /// The mechanism by which this device is managed by the MDM. "managedDevice" means that the MDM's app is a device owner. "managedProfile" means that the MDM's app is the profile owner (and there is a separate personal profile which is not managed). "containerApp" means that the MDM's app is managing the Android for Work container app on the device. + #[serde(rename="managementType")] + pub management_type: Option, } impl Resource for Device {} @@ -854,25 +924,39 @@ impl Resource for GroupLicense {} impl ResponseResult for GroupLicense {} -/// The grouplicense resources for the enterprise. +/// A user resource represents an individual user within the enterprise's domain. +/// +/// Note that each user is associated with a Google account based on the user's corporate email address (which must be in one of the enterprise's domains). As part of installing an MDM app to manage a device the Google account must be provisioned to the device, and so the user resource must be created before that. This can be done using the Google Admin SDK Directory API. +/// +/// The ID for a user is an opaque string. It can be retrieved using the list method queried by the user's primary email address. /// /// # 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 grouplicenses](struct.GrouplicenseListCall.html) (response) +/// * [revoke token users](struct.UserRevokeTokenCall.html) (none) +/// * [update collectionviewers](struct.CollectionviewerUpdateCall.html) (request|response) +/// * [patch collectionviewers](struct.CollectionviewerPatchCall.html) (request|response) +/// * [list users](struct.UserListCall.html) (none) +/// * [get collectionviewers](struct.CollectionviewerGetCall.html) (response) +/// * [generate token users](struct.UserGenerateTokenCall.html) (none) +/// * [get users](struct.UserGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GroupLicensesListResponse { - /// A group license for a product approved for use in the enterprise. - #[serde(rename="groupLicense")] - pub group_license: Option>, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicensesListResponse". +pub struct User { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#user". pub kind: Option, + /// The user's primary email, e.g. "jsmith@example.com". + #[serde(rename="primaryEmail")] + pub primary_email: Option, + /// The unique ID for the user. + pub id: Option, } -impl ResponseResult for GroupLicensesListResponse {} +impl RequestValue for User {} +impl Resource for User {} +impl ResponseResult for User {} @@ -1984,7 +2068,7 @@ impl<'a, C, A> EntitlementMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get(...)`, `get_app_restrictions_schema(...)`, `get_permissions(...)` and `update_permissions(...)` +/// // like `approve(...)`, `generate_approval_url(...)`, `get(...)`, `get_app_restrictions_schema(...)`, `get_permissions(...)` and `update_permissions(...)` /// // to build up your call. /// let rb = hub.products(); /// # } @@ -2038,6 +2122,27 @@ impl<'a, C, A> ProductMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Approves the specified product (and the relevant app permissions, if any). + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `enterpriseId` - The ID of the enterprise. + /// * `productId` - The ID of the product. + pub fn approve(&self, request: ProductsApproveRequest, enterprise_id: &str, product_id: &str) -> ProductApproveCall<'a, C, A> { + ProductApproveCall { + hub: self.hub, + _request: request, + _enterprise_id: enterprise_id.to_string(), + _product_id: product_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Retrieves the schema defining app restrictions configurable for this product. All products have a schema, but this may be empty if no app restrictions are defined. @@ -2078,6 +2183,26 @@ impl<'a, C, A> ProductMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// 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. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `productId` - The ID of the product. + pub fn generate_approval_url(&self, enterprise_id: &str, product_id: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { + ProductGenerateApprovalUrlCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _product_id: product_id.to_string(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -12327,6 +12452,274 @@ impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oa } +/// Approves the specified product (and the relevant app permissions, if any). +/// +/// A builder for the *approve* method supported by a *product* resource. +/// It is not used directly, but through a `ProductMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// use androidenterprise1::ProductsApproveRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::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 = ProductsApproveRequest::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.products().approve(req, "enterpriseId", "productId") +/// .doit(); +/// # } +/// ``` +pub struct ProductApproveCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _request: ProductsApproveRequest, + _enterprise_id: String, + _product_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProductApproveCall<'a, C, A> {} + +impl<'a, C, A> ProductApproveCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + 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: "androidenterprise.products.approve", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("productId", self._product_id.to_string())); + for &field in ["enterpriseId", "productId"].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())); + } + + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/approve".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{productId}", "productId")].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(2); + for param_name in ["productId", "enterpriseId"].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 = res; + + 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: ProductsApproveRequest) -> ProductApproveCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the enterprise. + /// + /// Sets the *enterprise 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 enterprise_id(mut self, new_value: &str) -> ProductApproveCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the product. + /// + /// Sets the *product 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 product_id(mut self, new_value: &str) -> ProductApproveCall<'a, C, A> { + self._product_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) -> ProductApproveCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProductApproveCall<'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::Full`. + /// + /// 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) -> ProductApproveCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Retrieves the schema defining app restrictions configurable for this product. All products have a schema, but this may be empty if no app restrictions are defined. /// /// A builder for the *getAppRestrictionsSchema* method supported by a *product* resource. @@ -12354,7 +12747,7 @@ impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.products().get_app_restrictions_schema("enterpriseId", "productId") -/// .language("ea") +/// .language("rebum.") /// .doit(); /// # } /// ``` @@ -12866,6 +13259,266 @@ impl<'a, C, A> ProductUpdatePermissionCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AndroidEnterprise::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.products().generate_approval_url("enterpriseId", "productId") +/// .language_code("sit") +/// .doit(); +/// # } +/// ``` +pub struct ProductGenerateApprovalUrlCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _product_id: String, + _language_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProductGenerateApprovalUrlCall<'a, C, A> {} + +impl<'a, C, A> ProductGenerateApprovalUrlCall<'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, ProductsGenerateApprovalUrlResponse)> { + 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: "androidenterprise.products.generateApprovalUrl", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("productId", self._product_id.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "enterpriseId", "productId", "languageCode"].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://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{productId}", "productId")].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(2); + for param_name in ["productId", "enterpriseId"].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::Post, &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 enterprise. + /// + /// Sets the *enterprise 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 enterprise_id(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the product. + /// + /// Sets the *product 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 product_id(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { + self._product_id = new_value.to_string(); + self + } + /// The language code that will be used for permission names and descriptions in the returned iframe. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { + self._language_code = 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) -> ProductGenerateApprovalUrlCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProductGenerateApprovalUrlCall<'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::Full`. + /// + /// 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) -> ProductGenerateApprovalUrlCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Retrieves details of an enterprise's group license for a product. /// /// A builder for the *get* method supported by a *grouplicense* resource. @@ -13377,7 +14030,7 @@ impl<'a, C, A> GrouplicenseListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().get("permissionId") -/// .language("sit") +/// .language("ea") /// .doit(); /// # } /// ``` diff --git a/gen/androidpublisher2-cli/Cargo.toml b/gen/androidpublisher2-cli/Cargo.toml index 6e1c9ad527..d5b2ef9397 100644 --- a/gen/androidpublisher2-cli/Cargo.toml +++ b/gen/androidpublisher2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androidpublisher2-cli" -version = "0.3.0+20150323" +version = "0.3.0+20150316" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Publisher (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidpublisher2-cli" @@ -17,8 +17,8 @@ keywords = ["androidpublisher", "google", "cli"] name = "androidpublisher2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/androidpublisher2-cli/README.md b/gen/androidpublisher2-cli/README.md index 53976fce6e..5ecf1de2c4 100644 --- a/gen/androidpublisher2-cli/README.md +++ b/gen/androidpublisher2-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Android Publisher* API at revision *20150323*. The CLI is at version *0.3.0*. +This documentation was generated from the *Android Publisher* API at revision *20150316*. The CLI is at version *0.3.0*. ```bash androidpublisher2 [options] @@ -67,6 +67,8 @@ androidpublisher2 [options] tracks-patch (-r )... [-p ]... [-o ] tracks-update (-r )... [-p ]... [-o ] validate [-p ]... [-o ] + entitlements + list [-p ]... [-o ] inappproducts batch (-r )... [-p ]... [-o ] delete [-p ]... diff --git a/gen/androidpublisher2-cli/mkdocs.yml b/gen/androidpublisher2-cli/mkdocs.yml index ee1a305929..75349614b7 100644 --- a/gen/androidpublisher2-cli/mkdocs.yml +++ b/gen/androidpublisher2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Publisher v0.3.0+20150323 +site_name: Android Publisher v0.3.0+20150316 site_url: http://byron.github.io/google-apis-rs/google-androidpublisher2-cli site_description: Write integrating applications with bcore @@ -47,6 +47,7 @@ pages: - ['edits_tracks-patch.md', 'Edits', 'Tracks Patch'] - ['edits_tracks-update.md', 'Edits', 'Tracks Update'] - ['edits_validate.md', 'Edits', 'Validate'] +- ['entitlements_list.md', 'Entitlements', 'List'] - ['inappproducts_batch.md', 'Inappproducts', 'Batch'] - ['inappproducts_delete.md', 'Inappproducts', 'Delete'] - ['inappproducts_get.md', 'Inappproducts', 'Get'] diff --git a/gen/androidpublisher2-cli/src/main.rs b/gen/androidpublisher2-cli/src/main.rs index d7c897ae58..ee7c72f648 100644 --- a/gen/androidpublisher2-cli/src/main.rs +++ b/gen/androidpublisher2-cli/src/main.rs @@ -180,6 +180,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -232,6 +233,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -318,6 +320,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -404,6 +407,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -501,6 +505,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -552,6 +557,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -607,6 +613,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -658,6 +665,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -753,6 +761,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -840,6 +849,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -927,6 +937,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -979,6 +990,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1065,6 +1077,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1151,6 +1164,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1207,6 +1221,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1258,6 +1273,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1353,6 +1369,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1404,6 +1421,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1459,6 +1477,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1544,6 +1563,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1683,6 +1703,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1734,6 +1755,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1822,6 +1844,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1910,6 +1933,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1961,6 +1985,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2046,6 +2071,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2131,6 +2157,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2182,6 +2209,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2233,6 +2261,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2319,6 +2348,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2405,6 +2435,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2456,6 +2487,69 @@ impl<'n, 'a> Engine<'n, 'a> { 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 _entitlements_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.entitlements().list(opt.value_of("package-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 { + "token" => { + call = call.token(value.unwrap_or("")); + }, + "start-index" => { + call = call.start_index(arg_from_str(value.unwrap_or("-0"), err, "start-index", "integer")); + }, + "product-id" => { + call = call.product_id(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "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(["token", "start-index", "max-results", "product-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + 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(()) } } @@ -2539,6 +2633,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2634,6 +2729,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2734,6 +2830,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2795,6 +2892,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2895,6 +2993,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2995,6 +3094,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3046,6 +3146,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3175,6 +3276,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3226,6 +3328,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3447,6 +3550,17 @@ impl<'n, 'a> Engine<'n, 'a> { } } }, + ("entitlements", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._entitlements_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("entitlements".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("inappproducts", Some(opt)) => { match opt.subcommand() { ("batch", Some(opt)) => { @@ -3536,7 +3650,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() @@ -3549,7 +3663,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() @@ -4934,6 +5048,31 @@ fn main() { ]), ]), + ("entitlements", "methods: 'list'", vec![ + ("list", + Some(r##"Lists the user's current inapp item or subscription entitlements"##), + "Details at http://byron.github.io/google-apis-rs/google_androidpublisher2_cli/entitlements_list", + vec![ + (Some(r##"package-name"##), + None, + Some(r##"The package name of the application the inapp product was sold in (for example, 'com.some.thing')."##), + 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)), + ]), + ]), + ("inappproducts", "methods: 'batch', 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ ("batch", None, @@ -5326,7 +5465,7 @@ fn main() { let mut app = App::new("androidpublisher2") .author("Sebastian Thiel ") - .version("0.3.0+20150323") + .version("0.3.0+20150316") .about("Lets Android application developers access their Google Play accounts.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_androidpublisher2_cli") .arg(Arg::with_name("url") diff --git a/gen/androidpublisher2/Cargo.toml b/gen/androidpublisher2/Cargo.toml index a98ad6caa0..644110e12e 100644 --- a/gen/androidpublisher2/Cargo.toml +++ b/gen/androidpublisher2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androidpublisher2" -version = "0.1.8+20150323" +version = "0.1.8+20150316" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Publisher (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidpublisher2" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/androidpublisher2/README.md b/gen/androidpublisher2/README.md index f78fb406a7..ed38d9f564 100644 --- a/gen/androidpublisher2/README.md +++ b/gen/androidpublisher2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-androidpublisher2` library allows access to all features of the *Google Android Publisher* service. -This documentation was generated from *Android Publisher* crate version *0.1.8+20150323*, where *20150323* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Android Publisher* crate version *0.1.8+20150316*, where *20150316* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *Android Publisher* *v2* API can be found at the [official documentation site](https://developers.google.com/android-publisher). @@ -15,6 +15,8 @@ Handle the following *Resources* with ease from the central [hub](http://byron.g * edits * [*apklistings delete*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditApklistingDeleteCall.html), [*apklistings deleteall*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditApklistingDeleteallCall.html), [*apklistings get*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditApklistingGetCall.html), [*apklistings list*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditApklistingListCall.html), [*apklistings patch*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditApklistingPatchCall.html), [*apklistings update*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditApklistingUpdateCall.html), [*apks addexternallyhosted*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditApkAddexternallyhostedCall.html), [*apks list*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditApkListCall.html), [*apks upload*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditApkUploadCall.html), [*commit*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditCommitCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditDeleteCall.html), [*details get*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditDetailGetCall.html), [*details patch*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditDetailPatchCall.html), [*details update*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditDetailUpdateCall.html), [*expansionfiles get*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditExpansionfileGetCall.html), [*expansionfiles patch*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditExpansionfilePatchCall.html), [*expansionfiles update*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditExpansionfileUpdateCall.html), [*expansionfiles upload*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditExpansionfileUploadCall.html), [*get*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditGetCall.html), [*images delete*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditImageDeleteCall.html), [*images deleteall*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditImageDeleteallCall.html), [*images list*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditImageListCall.html), [*images upload*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditImageUploadCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditInsertCall.html), [*listings delete*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditListingDeleteCall.html), [*listings deleteall*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditListingDeleteallCall.html), [*listings get*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditListingGetCall.html), [*listings list*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditListingListCall.html), [*listings patch*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditListingPatchCall.html), [*listings update*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditListingUpdateCall.html), [*testers get*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditTesterGetCall.html), [*testers patch*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditTesterPatchCall.html), [*testers update*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditTesterUpdateCall.html), [*tracks get*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditTrackGetCall.html), [*tracks list*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditTrackListCall.html), [*tracks patch*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditTrackPatchCall.html), [*tracks update*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditTrackUpdateCall.html) and [*validate*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EditValidateCall.html) +* [entitlements](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.Entitlement.html) + * [*list*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.EntitlementListCall.html) * inappproducts * [*batch*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.InappproductBatchCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.InappproductDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.InappproductGetCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.InappproductInsertCall.html), [*list*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.InappproductListCall.html), [*patch*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.InappproductPatchCall.html) and [*update*](http://byron.github.io/google-apis-rs/google_androidpublisher2/struct.InappproductUpdateCall.html) * purchases diff --git a/gen/androidpublisher2/src/cmn.rs b/gen/androidpublisher2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/androidpublisher2/src/cmn.rs +++ b/gen/androidpublisher2/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/androidpublisher2/src/lib.rs b/gen/androidpublisher2/src/lib.rs index 5ee2793868..b0710aa5eb 100644 --- a/gen/androidpublisher2/src/lib.rs +++ b/gen/androidpublisher2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Android Publisher* crate version *0.1.8+20150323*, where *20150323* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Android Publisher* crate version *0.1.8+20150316*, where *20150316* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *Android Publisher* *v2* API can be found at the //! [official documentation site](https://developers.google.com/android-publisher). @@ -13,6 +13,8 @@ //! //! * edits //! * [*apklistings delete*](struct.EditApklistingDeleteCall.html), [*apklistings deleteall*](struct.EditApklistingDeleteallCall.html), [*apklistings get*](struct.EditApklistingGetCall.html), [*apklistings list*](struct.EditApklistingListCall.html), [*apklistings patch*](struct.EditApklistingPatchCall.html), [*apklistings update*](struct.EditApklistingUpdateCall.html), [*apks addexternallyhosted*](struct.EditApkAddexternallyhostedCall.html), [*apks list*](struct.EditApkListCall.html), [*apks upload*](struct.EditApkUploadCall.html), [*commit*](struct.EditCommitCall.html), [*delete*](struct.EditDeleteCall.html), [*details get*](struct.EditDetailGetCall.html), [*details patch*](struct.EditDetailPatchCall.html), [*details update*](struct.EditDetailUpdateCall.html), [*expansionfiles get*](struct.EditExpansionfileGetCall.html), [*expansionfiles patch*](struct.EditExpansionfilePatchCall.html), [*expansionfiles update*](struct.EditExpansionfileUpdateCall.html), [*expansionfiles upload*](struct.EditExpansionfileUploadCall.html), [*get*](struct.EditGetCall.html), [*images delete*](struct.EditImageDeleteCall.html), [*images deleteall*](struct.EditImageDeleteallCall.html), [*images list*](struct.EditImageListCall.html), [*images upload*](struct.EditImageUploadCall.html), [*insert*](struct.EditInsertCall.html), [*listings delete*](struct.EditListingDeleteCall.html), [*listings deleteall*](struct.EditListingDeleteallCall.html), [*listings get*](struct.EditListingGetCall.html), [*listings list*](struct.EditListingListCall.html), [*listings patch*](struct.EditListingPatchCall.html), [*listings update*](struct.EditListingUpdateCall.html), [*testers get*](struct.EditTesterGetCall.html), [*testers patch*](struct.EditTesterPatchCall.html), [*testers update*](struct.EditTesterUpdateCall.html), [*tracks get*](struct.EditTrackGetCall.html), [*tracks list*](struct.EditTrackListCall.html), [*tracks patch*](struct.EditTrackPatchCall.html), [*tracks update*](struct.EditTrackUpdateCall.html) and [*validate*](struct.EditValidateCall.html) +//! * [entitlements](struct.Entitlement.html) +//! * [*list*](struct.EntitlementListCall.html) //! * inappproducts //! * [*batch*](struct.InappproductBatchCall.html), [*delete*](struct.InappproductDeleteCall.html), [*get*](struct.InappproductGetCall.html), [*insert*](struct.InappproductInsertCall.html), [*list*](struct.InappproductListCall.html), [*patch*](struct.InappproductPatchCall.html) and [*update*](struct.InappproductUpdateCall.html) //! * purchases diff --git a/gen/androidpublisher2/src/lib.rs.in b/gen/androidpublisher2/src/lib.rs.in index 0313a50521..33944dde42 100644 --- a/gen/androidpublisher2/src/lib.rs.in +++ b/gen/androidpublisher2/src/lib.rs.in @@ -139,6 +139,9 @@ impl<'a, C, A> AndroidPublisher pub fn edits(&'a self) -> EditMethods<'a, C, A> { EditMethods { hub: &self } } + pub fn entitlements(&'a self) -> EntitlementMethods<'a, C, A> { + EntitlementMethods { hub: &self } + } pub fn inappproducts(&'a self) -> InappproductMethods<'a, C, A> { InappproductMethods { hub: &self } } @@ -161,6 +164,34 @@ impl<'a, C, A> AndroidPublisher // ############ // SCHEMAS ### // ########## +/// An Entitlement resource indicates a user's current entitlement to an inapp item or subscription. +/// +/// # 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 entitlements](struct.EntitlementListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Entitlement { + /// This kind represents an entitlement object in the androidpublisher service. + pub kind: Option, + /// The token which can be verified using the subscriptions or products API. + pub token: Option, + /// The type of the inapp product. Possible values are: + /// - In-app item: "inapp" + /// - Subscription: "subs" + #[serde(rename="productType")] + pub product_type: Option, + /// The SKU of the product. + #[serde(rename="productId")] + pub product_id: Option, +} + +impl Resource for Entitlement {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -442,17 +473,26 @@ impl ResponseResult for Track {} /// There is no detailed description. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # 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 entitlements](struct.EntitlementListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Season { - /// Inclusive start date of the recurrence period. - pub start: Option, - /// Inclusive end date of the recurrence period. - pub end: Option, +pub struct EntitlementsListResponse { + /// no description provided + #[serde(rename="tokenPagination")] + pub token_pagination: Option, + /// no description provided + #[serde(rename="pageInfo")] + pub page_info: Option, + /// no description provided + pub resources: Option>, } -impl Part for Season {} +impl ResponseResult for EntitlementsListResponse {} /// There is no detailed description. @@ -607,6 +647,31 @@ pub struct InappproductsBatchResponseEntry { impl Part for InappproductsBatchResponseEntry {} +/// Represents an edit of an app. An edit allows clients to make multiple changes before committing them in one operation. +/// +/// # 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*). +/// +/// * [insert edits](struct.EditInsertCall.html) (request|response) +/// * [commit edits](struct.EditCommitCall.html) (response) +/// * [validate edits](struct.EditValidateCall.html) (response) +/// * [get edits](struct.EditGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AppEdit { + /// The time at which the edit will expire and will be no longer valid for use in any subsequent API calls (encoded as seconds since the Epoch). + #[serde(rename="expiryTimeSeconds")] + pub expiry_time_seconds: Option, + /// The ID of the edit that can be used in subsequent API calls. + pub id: Option, +} + +impl RequestValue for AppEdit {} +impl ResponseResult for AppEdit {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -859,29 +924,21 @@ pub struct SubscriptionPurchase { impl ResponseResult for SubscriptionPurchase {} -/// Represents an edit of an app. An edit allows clients to make multiple changes before committing them in one operation. +/// 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*). -/// -/// * [insert edits](struct.EditInsertCall.html) (request|response) -/// * [commit edits](struct.EditCommitCall.html) (response) -/// * [validate edits](struct.EditValidateCall.html) (response) -/// * [get edits](struct.EditGetCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AppEdit { - /// The time at which the edit will expire and will be no longer valid for use in any subsequent API calls (encoded as seconds since the Epoch). - #[serde(rename="expiryTimeSeconds")] - pub expiry_time_seconds: Option, - /// The ID of the edit that can be used in subsequent API calls. +pub struct Image { + /// A URL that will serve a preview of the image. + pub url: Option, + /// A sha1 hash of the image that was uploaded. + pub sha1: Option, + /// A unique id representing this image. pub id: Option, } -impl RequestValue for AppEdit {} -impl ResponseResult for AppEdit {} +impl Part for Image {} /// There is no detailed description. @@ -1001,16 +1058,14 @@ impl ResponseResult for InappproductsBatchResponse {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Image { - /// A URL that will serve a preview of the image. - pub url: Option, - /// A sha1 hash of the image that was uploaded. - pub sha1: Option, - /// A unique id representing this image. - pub id: Option, +pub struct Season { + /// Inclusive start date of the recurrence period. + pub start: Option, + /// Inclusive end date of the recurrence period. + pub end: Option, } -impl Part for Image {} +impl Part for Season {} /// There is no detailed description. @@ -1086,6 +1141,67 @@ impl ResponseResult for ListingsListResponse {} // MethodBuilders ### // ################# +/// A builder providing access to all methods supported on *entitlement* resources. +/// It is not used directly, but through the `AndroidPublisher` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_androidpublisher2 as androidpublisher2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use androidpublisher2::AndroidPublisher; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = AndroidPublisher::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `list(...)` +/// // to build up your call. +/// let rb = hub.entitlements(); +/// # } +/// ``` +pub struct EntitlementMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidPublisher, +} + +impl<'a, C, A> MethodsBuilder for EntitlementMethods<'a, C, A> {} + +impl<'a, C, A> EntitlementMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists the user's current inapp item or subscription entitlements + /// + /// # Arguments + /// + /// * `packageName` - The package name of the application the inapp product was sold in (for example, 'com.some.thing'). + pub fn list(&self, package_name: &str) -> EntitlementListCall<'a, C, A> { + EntitlementListCall { + hub: self.hub, + _package_name: package_name.to_string(), + _token: Default::default(), + _start_index: Default::default(), + _product_id: Default::default(), + _max_results: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *purchase* resources. /// It is not used directly, but through the `AndroidPublisher` hub. /// @@ -1360,29 +1476,6 @@ impl<'a, C, A> EditMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Deletes the APK-specific localized listing for a specified APK and language code. - /// - /// # Arguments - /// - /// * `packageName` - Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - /// * `editId` - Unique identifier for this edit. - /// * `apkVersionCode` - The APK version code whose APK-specific listings should be read or modified. - /// * `language` - The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass "de-AT". - pub fn apklistings_delete(&self, package_name: &str, edit_id: &str, apk_version_code: i32, language: &str) -> EditApklistingDeleteCall<'a, C, A> { - EditApklistingDeleteCall { - hub: self.hub, - _package_name: package_name.to_string(), - _edit_id: edit_id.to_string(), - _apk_version_code: apk_version_code, - _language: language.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes all localized listings from an edit. @@ -1727,6 +1820,29 @@ impl<'a, C, A> EditMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes the APK-specific localized listing for a specified APK and language code. + /// + /// # Arguments + /// + /// * `packageName` - Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + /// * `editId` - Unique identifier for this edit. + /// * `apkVersionCode` - The APK version code whose APK-specific listings should be read or modified. + /// * `language` - The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + pub fn apklistings_delete(&self, package_name: &str, edit_id: &str, apk_version_code: i32, language: &str) -> EditApklistingDeleteCall<'a, C, A> { + EditApklistingDeleteCall { + hub: self.hub, + _package_name: package_name.to_string(), + _edit_id: edit_id.to_string(), + _apk_version_code: apk_version_code, + _language: language.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// /// # Arguments /// @@ -2286,6 +2402,264 @@ impl<'a, C, A> InappproductMethods<'a, C, A> { // CallBuilders ### // ################# +/// Lists the user's current inapp item or subscription entitlements +/// +/// A builder for the *list* method supported by a *entitlement* resource. +/// It is not used directly, but through a `EntitlementMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidpublisher2 as androidpublisher2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidpublisher2::AndroidPublisher; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = AndroidPublisher::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.entitlements().list("packageName") +/// .token("accusam") +/// .start_index(93) +/// .product_id("justo") +/// .max_results(100) +/// .doit(); +/// # } +/// ``` +pub struct EntitlementListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidPublisher, + _package_name: String, + _token: Option, + _start_index: Option, + _product_id: Option, + _max_results: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for EntitlementListCall<'a, C, A> {} + +impl<'a, C, A> EntitlementListCall<'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, EntitlementsListResponse)> { + 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: "androidpublisher.entitlements.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("packageName", self._package_name.to_string())); + if let Some(value) = self._token { + params.push(("token", value.to_string())); + } + if let Some(value) = self._start_index { + params.push(("startIndex", value.to_string())); + } + if let Some(value) = self._product_id { + params.push(("productId", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + for &field in ["alt", "packageName", "token", "startIndex", "productId", "maxResults"].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://www.googleapis.com/androidpublisher/v2/applications/{packageName}/entitlements".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + for &(find_this, param_name) in [("{packageName}", "packageName")].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 ["packageName"].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 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())); + + 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 package name of the application the inapp product was sold in (for example, 'com.some.thing'). + /// + /// Sets the *package 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 package_name(mut self, new_value: &str) -> EntitlementListCall<'a, C, A> { + self._package_name = new_value.to_string(); + self + } + /// + /// Sets the *token* query property to the given value. + pub fn token(mut self, new_value: &str) -> EntitlementListCall<'a, C, A> { + self._token = Some(new_value.to_string()); + self + } + /// + /// Sets the *start index* query property to the given value. + pub fn start_index(mut self, new_value: u32) -> EntitlementListCall<'a, C, A> { + self._start_index = Some(new_value); + self + } + /// The product id of the inapp product (for example, 'sku1'). This can be used to restrict the result set. + /// + /// Sets the *product id* query property to the given value. + pub fn product_id(mut self, new_value: &str) -> EntitlementListCall<'a, C, A> { + self._product_id = Some(new_value.to_string()); + self + } + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> EntitlementListCall<'a, C, A> { + self._max_results = 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) -> EntitlementListCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EntitlementListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + /// Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring. /// /// A builder for the *subscriptions.revoke* method supported by a *purchase* resource. @@ -4259,7 +4633,7 @@ impl<'a, C, A> EditImageUploadCall<'a, C, A> where C: BorrowMut, /// // 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.edits().expansionfiles_update(req, "packageName", "editId", -32, "expansionFileType") +/// let result = hub.edits().expansionfiles_update(req, "packageName", "editId", -95, "expansionFileType") /// .doit(); /// # } /// ``` @@ -4777,267 +5151,6 @@ impl<'a, C, A> EditDetailGetCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes the APK-specific localized listing for a specified APK and language code. -/// -/// A builder for the *apklistings.delete* method supported by a *edit* resource. -/// It is not used directly, but through a `EditMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidpublisher2 as androidpublisher2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidpublisher2::AndroidPublisher; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidPublisher::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.edits().apklistings_delete("packageName", "editId", -48, "language") -/// .doit(); -/// # } -/// ``` -pub struct EditApklistingDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidPublisher, - _package_name: String, - _edit_id: String, - _apk_version_code: i32, - _language: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EditApklistingDeleteCall<'a, C, A> {} - -impl<'a, C, A> EditApklistingDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - 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: "androidpublisher.edits.apklistings.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("packageName", self._package_name.to_string())); - params.push(("editId", self._edit_id.to_string())); - params.push(("apkVersionCode", self._apk_version_code.to_string())); - params.push(("language", self._language.to_string())); - for &field in ["packageName", "editId", "apkVersionCode", "language"].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())); - } - - - let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{packageName}", "packageName"), ("{editId}", "editId"), ("{apkVersionCode}", "apkVersionCode"), ("{language}", "language")].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(4); - for param_name in ["language", "apkVersionCode", "editId", "packageName"].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 = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - /// - /// Sets the *package 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 package_name(mut self, new_value: &str) -> EditApklistingDeleteCall<'a, C, A> { - self._package_name = new_value.to_string(); - self - } - /// Unique identifier for this edit. - /// - /// Sets the *edit 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 edit_id(mut self, new_value: &str) -> EditApklistingDeleteCall<'a, C, A> { - self._edit_id = new_value.to_string(); - self - } - /// The APK version code whose APK-specific listings should be read or modified. - /// - /// Sets the *apk version code* 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 apk_version_code(mut self, new_value: i32) -> EditApklistingDeleteCall<'a, C, A> { - self._apk_version_code = new_value; - self - } - /// The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass "de-AT". - /// - /// Sets the *language* 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 language(mut self, new_value: &str) -> EditApklistingDeleteCall<'a, C, A> { - self._language = 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) -> EditApklistingDeleteCall<'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 - /// - /// * *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. Overrides userIp if both are provided. - /// * *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. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EditApklistingDeleteCall<'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::Full`. - /// - /// 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) -> EditApklistingDeleteCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Deletes all localized listings from an edit. /// /// A builder for the *listings.deleteall* method supported by a *edit* resource. @@ -5580,7 +5693,7 @@ impl<'a, C, A> EditApkAddexternallyhostedCall<'a, C, A> where C: BorrowMut EditTrackGetCall<'a, C, A> where C: BorrowMut, A: /// // 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.edits().expansionfiles_patch(req, "packageName", "editId", -40, "expansionFileType") +/// let result = hub.edits().expansionfiles_patch(req, "packageName", "editId", -58, "expansionFileType") /// .doit(); /// # } /// ``` @@ -8407,7 +8520,7 @@ impl<'a, C, A> EditApkUploadCall<'a, C, A> where C: BorrowMut, A: /// // 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.edits().apklistings_update(req, "packageName", "editId", -45, "language") +/// let result = hub.edits().apklistings_update(req, "packageName", "editId", -44, "language") /// .doit(); /// # } /// ``` @@ -8956,7 +9069,7 @@ impl<'a, C, A> EditApkListCall<'a, C, A> where C: BorrowMut, A: o /// // 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.edits().apklistings_patch(req, "packageName", "editId", -84, "language") +/// let result = hub.edits().apklistings_patch(req, "packageName", "editId", -19, "language") /// .doit(); /// # } /// ``` @@ -9487,6 +9600,267 @@ impl<'a, C, A> EditListingGetCall<'a, C, A> where C: BorrowMut, A } +/// Deletes the APK-specific localized listing for a specified APK and language code. +/// +/// A builder for the *apklistings.delete* method supported by a *edit* resource. +/// It is not used directly, but through a `EditMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidpublisher2 as androidpublisher2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidpublisher2::AndroidPublisher; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = AndroidPublisher::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.edits().apklistings_delete("packageName", "editId", -40, "language") +/// .doit(); +/// # } +/// ``` +pub struct EditApklistingDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidPublisher, + _package_name: String, + _edit_id: String, + _apk_version_code: i32, + _language: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EditApklistingDeleteCall<'a, C, A> {} + +impl<'a, C, A> EditApklistingDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + 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: "androidpublisher.edits.apklistings.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("packageName", self._package_name.to_string())); + params.push(("editId", self._edit_id.to_string())); + params.push(("apkVersionCode", self._apk_version_code.to_string())); + params.push(("language", self._language.to_string())); + for &field in ["packageName", "editId", "apkVersionCode", "language"].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())); + } + + + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{packageName}", "packageName"), ("{editId}", "editId"), ("{apkVersionCode}", "apkVersionCode"), ("{language}", "language")].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(4); + for param_name in ["language", "apkVersionCode", "editId", "packageName"].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 = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + /// + /// Sets the *package 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 package_name(mut self, new_value: &str) -> EditApklistingDeleteCall<'a, C, A> { + self._package_name = new_value.to_string(); + self + } + /// Unique identifier for this edit. + /// + /// Sets the *edit 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 edit_id(mut self, new_value: &str) -> EditApklistingDeleteCall<'a, C, A> { + self._edit_id = new_value.to_string(); + self + } + /// The APK version code whose APK-specific listings should be read or modified. + /// + /// Sets the *apk version code* 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 apk_version_code(mut self, new_value: i32) -> EditApklistingDeleteCall<'a, C, A> { + self._apk_version_code = new_value; + self + } + /// The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + /// + /// Sets the *language* 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 language(mut self, new_value: &str) -> EditApklistingDeleteCall<'a, C, A> { + self._language = 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) -> EditApklistingDeleteCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EditApklistingDeleteCall<'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::Full`. + /// + /// 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) -> EditApklistingDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// A builder for the *testers.get* method supported by a *edit* resource. /// It is not used directly, but through a `EditMethods` instance. /// @@ -10008,7 +10382,7 @@ impl<'a, C, A> EditDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.edits().expansionfiles_upload("packageName", "editId", -27, "expansionFileType") +/// let result = hub.edits().expansionfiles_upload("packageName", "editId", -66, "expansionFileType") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -12228,7 +12602,7 @@ impl<'a, C, A> EditListingUpdateCall<'a, C, A> where C: BorrowMut /// // 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.edits().expansionfiles_get("packageName", "editId", -38, "expansionFileType") +/// let result = hub.edits().expansionfiles_get("packageName", "editId", -69, "expansionFileType") /// .doit(); /// # } /// ``` @@ -13589,7 +13963,7 @@ impl<'a, C, A> EditListingDeleteCall<'a, C, A> where C: BorrowMut /// // 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.edits().apklistings_get("packageName", "editId", -57, "language") +/// let result = hub.edits().apklistings_get("packageName", "editId", -24, "language") /// .doit(); /// # } /// ``` @@ -14149,7 +14523,7 @@ impl<'a, C, A> EditTesterUpdateCall<'a, C, A> where C: BorrowMut, /// // 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.edits().apklistings_list("packageName", "editId", -19) +/// let result = hub.edits().apklistings_list("packageName", "editId", -74) /// .doit(); /// # } /// ``` @@ -14642,9 +15016,9 @@ impl<'a, C, A> InappproductBatchCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.inappproducts().list("packageName") -/// .token("aliquyam") -/// .start_index(34) -/// .max_results(84) +/// .token("diam") +/// .start_index(39) +/// .max_results(14) /// .doit(); /// # } /// ``` @@ -15680,7 +16054,7 @@ impl<'a, C, A> InappproductGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.inappproducts().update(req, "packageName", "sku") -/// .auto_convert_missing_prices(true) +/// .auto_convert_missing_prices(false) /// .doit(); /// # } /// ``` @@ -15971,7 +16345,7 @@ impl<'a, C, A> InappproductUpdateCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with appsactivity (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appsactivity1-cli" @@ -17,8 +17,8 @@ keywords = ["appsactivity", "google", "cli"] name = "appsactivity1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/appsactivity1-cli/README.md b/gen/appsactivity1-cli/README.md index e51a511eb8..fd81926afb 100644 --- a/gen/appsactivity1-cli/README.md +++ b/gen/appsactivity1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *appsactivity* API at revision *20140828*. The CLI is at version *0.3.0*. +This documentation was generated from the *appsactivity* API at revision *20150326*. The CLI is at version *0.3.0*. ```bash appsactivity1 [options] diff --git a/gen/appsactivity1-cli/mkdocs.yml b/gen/appsactivity1-cli/mkdocs.yml index 8377ca50b5..0302a2f276 100644 --- a/gen/appsactivity1-cli/mkdocs.yml +++ b/gen/appsactivity1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appsactivity v0.3.0+20140828 +site_name: appsactivity v0.3.0+20150326 site_url: http://byron.github.io/google-apis-rs/google-appsactivity1-cli site_description: Write integrating applications with bcore diff --git a/gen/appsactivity1-cli/src/main.rs b/gen/appsactivity1-cli/src/main.rs index ac711d33ef..e77502ca92 100644 --- a/gen/appsactivity1-cli/src/main.rs +++ b/gen/appsactivity1-cli/src/main.rs @@ -111,6 +111,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -167,7 +168,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() @@ -180,7 +181,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() @@ -238,7 +239,7 @@ fn main() { let mut app = App::new("appsactivity1") .author("Sebastian Thiel ") - .version("0.3.0+20140828") + .version("0.3.0+20150326") .about("Provides a historical view of activity.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_appsactivity1_cli") .arg(Arg::with_name("url") diff --git a/gen/appsactivity1/Cargo.toml b/gen/appsactivity1/Cargo.toml index 915e2039ef..d20cea91b3 100644 --- a/gen/appsactivity1/Cargo.toml +++ b/gen/appsactivity1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appsactivity1" -version = "0.1.8+20140828" +version = "0.1.8+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with appsactivity (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appsactivity1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/appsactivity1/README.md b/gen/appsactivity1/README.md index 54ea8ce9a0..fef082df9d 100644 --- a/gen/appsactivity1/README.md +++ b/gen/appsactivity1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-appsactivity1` library allows access to all features of the *Google appsactivity* service. -This documentation was generated from *appsactivity* crate version *0.1.8+20140828*, where *20140828* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *appsactivity* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *appsactivity* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/activity/). diff --git a/gen/appsactivity1/src/cmn.rs b/gen/appsactivity1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/appsactivity1/src/cmn.rs +++ b/gen/appsactivity1/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/appsactivity1/src/lib.rs b/gen/appsactivity1/src/lib.rs index ec744fe1d5..8cf424afcb 100644 --- a/gen/appsactivity1/src/lib.rs +++ b/gen/appsactivity1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *appsactivity* crate version *0.1.8+20140828*, where *20140828* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *appsactivity* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *appsactivity* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/activity/). diff --git a/gen/appsactivity1/src/lib.rs.in b/gen/appsactivity1/src/lib.rs.in index a1d47cc780..96da5c19a2 100644 --- a/gen/appsactivity1/src/lib.rs.in +++ b/gen/appsactivity1/src/lib.rs.in @@ -40,6 +40,9 @@ pub enum Scope { /// View the activity history of your Google Apps Activity, + /// View and manage metadata of files in your Google Drive + DriveMetadata, + /// View metadata for files in your Google Drive DriveMetadataReadonly, @@ -52,6 +55,7 @@ impl AsRef for Scope { match *self { Scope::Drive => "https://www.googleapis.com/auth/drive", Scope::Activity => "https://www.googleapis.com/auth/activity", + Scope::DriveMetadata => "https://www.googleapis.com/auth/drive.metadata", Scope::DriveMetadataReadonly => "https://www.googleapis.com/auth/drive.metadata.readonly", Scope::DriveReadonly => "https://www.googleapis.com/auth/drive.readonly", } diff --git a/gen/appstate1-cli/Cargo.toml b/gen/appstate1-cli/Cargo.toml index 4aa8c2b0a6..2acb146404 100644 --- a/gen/appstate1-cli/Cargo.toml +++ b/gen/appstate1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appstate1-cli" -version = "0.3.0+20150414" +version = "0.3.0+20150527" authors = ["Sebastian Thiel "] description = "A complete library to interact with App State (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appstate1-cli" @@ -17,8 +17,8 @@ keywords = ["appstate", "google", "cli"] name = "appstate1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/appstate1-cli/README.md b/gen/appstate1-cli/README.md index 9a070a0e92..01866fa3c3 100644 --- a/gen/appstate1-cli/README.md +++ b/gen/appstate1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *App State* API at revision *20150414*. The CLI is at version *0.3.0*. +This documentation was generated from the *App State* API at revision *20150527*. The CLI is at version *0.3.0*. ```bash appstate1 [options] diff --git a/gen/appstate1-cli/mkdocs.yml b/gen/appstate1-cli/mkdocs.yml index 78c22aa342..bdefc7cb0c 100644 --- a/gen/appstate1-cli/mkdocs.yml +++ b/gen/appstate1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: App State v0.3.0+20150414 +site_name: App State v0.3.0+20150527 site_url: http://byron.github.io/google-apis-rs/google-appstate1-cli site_description: Write integrating applications with bcore diff --git a/gen/appstate1-cli/src/main.rs b/gen/appstate1-cli/src/main.rs index 3873f8fcf6..fb870e9830 100644 --- a/gen/appstate1-cli/src/main.rs +++ b/gen/appstate1-cli/src/main.rs @@ -94,6 +94,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -191,6 +192,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -246,6 +248,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -336,6 +339,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -404,7 +408,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() @@ -417,7 +421,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() @@ -563,7 +567,7 @@ fn main() { let mut app = App::new("appstate1") .author("Sebastian Thiel ") - .version("0.3.0+20150414") + .version("0.3.0+20150527") .about("The Google App State API.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_appstate1_cli") .arg(Arg::with_name("url") diff --git a/gen/appstate1/Cargo.toml b/gen/appstate1/Cargo.toml index d9dfef4342..603f68e19d 100644 --- a/gen/appstate1/Cargo.toml +++ b/gen/appstate1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appstate1" -version = "0.1.8+20150414" +version = "0.1.8+20150527" authors = ["Sebastian Thiel "] description = "A complete library to interact with App State (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appstate1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/appstate1/README.md b/gen/appstate1/README.md index 9f23a267a2..c9c0485f5e 100644 --- a/gen/appstate1/README.md +++ b/gen/appstate1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-appstate1` library allows access to all features of the *Google App State* service. -This documentation was generated from *App State* crate version *0.1.8+20150414*, where *20150414* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *App State* crate version *0.1.8+20150527*, where *20150527* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *App State* *v1* API can be found at the [official documentation site](https://developers.google.com/games/services/web/api/states). diff --git a/gen/appstate1/src/cmn.rs b/gen/appstate1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/appstate1/src/cmn.rs +++ b/gen/appstate1/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/appstate1/src/lib.rs b/gen/appstate1/src/lib.rs index b7e6b164cb..7bccb23a5f 100644 --- a/gen/appstate1/src/lib.rs +++ b/gen/appstate1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *App State* crate version *0.1.8+20150414*, where *20150414* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *App State* crate version *0.1.8+20150527*, where *20150527* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *App State* *v1* API can be found at the //! [official documentation site](https://developers.google.com/games/services/web/api/states). diff --git a/gen/audit1-cli/Cargo.toml b/gen/audit1-cli/Cargo.toml index 9f610006fc..4c1e4dee38 100644 --- a/gen/audit1-cli/Cargo.toml +++ b/gen/audit1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["audit", "google", "cli"] name = "audit1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/audit1-cli/src/main.rs b/gen/audit1-cli/src/main.rs index fdd503de42..6c3f03ae24 100644 --- a/gen/audit1-cli/src/main.rs +++ b/gen/audit1-cli/src/main.rs @@ -114,6 +114,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -170,7 +171,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() @@ -183,7 +184,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() diff --git a/gen/audit1/Cargo.toml b/gen/audit1/Cargo.toml index 88720b1eab..da21026276 100644 --- a/gen/audit1/Cargo.toml +++ b/gen/audit1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/audit1/src/cmn.rs b/gen/audit1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/audit1/src/cmn.rs +++ b/gen/audit1/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/autoscaler1_beta2-cli/Cargo.toml b/gen/autoscaler1_beta2-cli/Cargo.toml index 49c1d59ce2..c62070eadc 100644 --- a/gen/autoscaler1_beta2-cli/Cargo.toml +++ b/gen/autoscaler1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-autoscaler1_beta2-cli" -version = "0.3.0+20141112" +version = "0.3.0+20150617" authors = ["Sebastian Thiel "] description = "A complete library to interact with autoscaler (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/autoscaler1_beta2-cli" @@ -17,8 +17,8 @@ keywords = ["autoscaler", "google", "cli"] name = "autoscaler1-beta2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/autoscaler1_beta2-cli/README.md b/gen/autoscaler1_beta2-cli/README.md index adef58fe7a..cbcbec089a 100644 --- a/gen/autoscaler1_beta2-cli/README.md +++ b/gen/autoscaler1_beta2-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *autoscaler* API at revision *20141112*. The CLI is at version *0.3.0*. +This documentation was generated from the *autoscaler* API at revision *20150617*. The CLI is at version *0.3.0*. ```bash autoscaler1-beta2 [options] diff --git a/gen/autoscaler1_beta2-cli/mkdocs.yml b/gen/autoscaler1_beta2-cli/mkdocs.yml index ef317f317a..bb3b5a7f1e 100644 --- a/gen/autoscaler1_beta2-cli/mkdocs.yml +++ b/gen/autoscaler1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: autoscaler v0.3.0+20141112 +site_name: autoscaler v0.3.0+20150617 site_url: http://byron.github.io/google-apis-rs/google-autoscaler1_beta2-cli site_description: Write integrating applications with bcore diff --git a/gen/autoscaler1_beta2-cli/src/main.rs b/gen/autoscaler1_beta2-cli/src/main.rs index 562f5e252e..e48a14066f 100644 --- a/gen/autoscaler1_beta2-cli/src/main.rs +++ b/gen/autoscaler1_beta2-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -140,6 +141,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -235,6 +237,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -296,6 +299,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -391,6 +395,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -486,6 +491,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -581,6 +587,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -642,6 +649,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -703,6 +711,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -802,7 +811,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() @@ -815,7 +824,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() @@ -1185,7 +1194,7 @@ fn main() { let mut app = App::new("autoscaler1-beta2") .author("Sebastian Thiel ") - .version("0.3.0+20141112") + .version("0.3.0+20150617") .about("The Google Compute Engine Autoscaler API provides autoscaling for groups of Cloud VMs.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_autoscaler1_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/autoscaler1_beta2/Cargo.toml b/gen/autoscaler1_beta2/Cargo.toml index 1882e7e2b7..dd417e9557 100644 --- a/gen/autoscaler1_beta2/Cargo.toml +++ b/gen/autoscaler1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-autoscaler1_beta2" -version = "0.1.8+20141112" +version = "0.1.8+20150617" authors = ["Sebastian Thiel "] description = "A complete library to interact with autoscaler (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/autoscaler1_beta2" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/autoscaler1_beta2/README.md b/gen/autoscaler1_beta2/README.md index 5c52f56d44..437bbb4549 100644 --- a/gen/autoscaler1_beta2/README.md +++ b/gen/autoscaler1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-autoscaler1_beta2` library allows access to all features of the *Google autoscaler* service. -This documentation was generated from *autoscaler* crate version *0.1.8+20141112*, where *20141112* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *autoscaler* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *autoscaler* *v1_beta2* API can be found at the [official documentation site](http://developers.google.com/compute/docs/autoscaler). diff --git a/gen/autoscaler1_beta2/src/cmn.rs b/gen/autoscaler1_beta2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/autoscaler1_beta2/src/cmn.rs +++ b/gen/autoscaler1_beta2/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/autoscaler1_beta2/src/lib.rs b/gen/autoscaler1_beta2/src/lib.rs index 7a91c194e5..dd3743ca8f 100644 --- a/gen/autoscaler1_beta2/src/lib.rs +++ b/gen/autoscaler1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *autoscaler* crate version *0.1.8+20141112*, where *20141112* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *autoscaler* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *autoscaler* *v1_beta2* API can be found at the //! [official documentation site](http://developers.google.com/compute/docs/autoscaler). diff --git a/gen/autoscaler1_beta2/src/lib.rs.in b/gen/autoscaler1_beta2/src/lib.rs.in index e21040fb0b..a403fefe9c 100644 --- a/gen/autoscaler1_beta2/src/lib.rs.in +++ b/gen/autoscaler1_beta2/src/lib.rs.in @@ -211,7 +211,7 @@ impl Part for OperationWarningsData {} pub struct Zone { /// no description provided pub status: Option, - /// Type of the resource. + /// [Output Only] Type of the resource. Always kind#zone for zones. pub kind: Option, /// no description provided pub description: Option, @@ -227,7 +227,7 @@ pub struct Zone { pub creation_timestamp: Option, /// no description provided pub id: Option, - /// Server defined URL for the resource (output only). + /// [Output Only] Server defined URL for the resource. #[serde(rename="selfLink")] pub self_link: Option, /// no description provided @@ -271,7 +271,7 @@ pub struct OperationList { pub next_page_token: Option, /// no description provided pub items: Option>, - /// Type of resource. Always compute#operations for Operations resource. + /// [Output Only] Type of resource. Always compute#operations for Operations resource. pub kind: Option, /// no description provided pub id: Option, @@ -477,7 +477,7 @@ pub struct Operation { pub creation_timestamp: Option, /// no description provided pub id: Option, - /// [Output Only] Type of the resource. Always kind#operation for Operation resources. + /// [Output Only] Type of the resource. Always compute#Operation for Operation resources. pub kind: Option, /// no description provided pub name: Option, diff --git a/gen/bigquery2-cli/Cargo.toml b/gen/bigquery2-cli/Cargo.toml index d8b8ea393f..10ac0b48ae 100644 --- a/gen/bigquery2-cli/Cargo.toml +++ b/gen/bigquery2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-bigquery2-cli" -version = "0.3.0+20150326" +version = "0.3.0+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with bigquery (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/bigquery2-cli" @@ -17,8 +17,8 @@ keywords = ["bigquery", "google", "cli"] name = "bigquery2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/bigquery2-cli/README.md b/gen/bigquery2-cli/README.md index a23d6315d3..e1976fd5cf 100644 --- a/gen/bigquery2-cli/README.md +++ b/gen/bigquery2-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *bigquery* API at revision *20150326*. The CLI is at version *0.3.0*. +This documentation was generated from the *bigquery* API at revision *20150526*. The CLI is at version *0.3.0*. ```bash bigquery2 [options] @@ -36,6 +36,7 @@ bigquery2 [options] patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] jobs + cancel [-p ]... [-o ] get [-p ]... [-o ] get-query-results [-p ]... [-o ] insert (-r )... (-u (simple|resumable) -f [-m ]) [-p ]... [-o ] diff --git a/gen/bigquery2-cli/mkdocs.yml b/gen/bigquery2-cli/mkdocs.yml index c50216c14a..39930e4628 100644 --- a/gen/bigquery2-cli/mkdocs.yml +++ b/gen/bigquery2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: bigquery v0.3.0+20150326 +site_name: bigquery v0.3.0+20150526 site_url: http://byron.github.io/google-apis-rs/google-bigquery2-cli site_description: Write integrating applications with bcore @@ -15,6 +15,7 @@ pages: - ['datasets_list.md', 'Datasets', 'List'] - ['datasets_patch.md', 'Datasets', 'Patch'] - ['datasets_update.md', 'Datasets', 'Update'] +- ['jobs_cancel.md', 'Jobs', 'Cancel'] - ['jobs_get.md', 'Jobs', 'Get'] - ['jobs_get-query-results.md', 'Jobs', 'Get Query Results'] - ['jobs_insert.md', 'Jobs', 'Insert'] diff --git a/gen/bigquery2-cli/src/main.rs b/gen/bigquery2-cli/src/main.rs index e66c0a721c..be57867ed7 100644 --- a/gen/bigquery2-cli/src/main.rs +++ b/gen/bigquery2-cli/src/main.rs @@ -137,6 +137,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -173,12 +174,13 @@ impl<'n, 'a> Engine<'n, 'a> { "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-table-expiration-ms" => Some(("defaultTableExpirationMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "friendly-name" => Some(("friendlyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "dataset-reference", "default-table-expiration-ms", "description", "etag", "friendly-name", "id", "kind", "last-modified-time", "project-id", "self-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "dataset-reference", "default-table-expiration-ms", "description", "etag", "friendly-name", "id", "kind", "last-modified-time", "location", "project-id", "self-link"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -231,6 +233,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -292,6 +295,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -328,12 +332,13 @@ impl<'n, 'a> Engine<'n, 'a> { "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-table-expiration-ms" => Some(("defaultTableExpirationMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "friendly-name" => Some(("friendlyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "dataset-reference", "default-table-expiration-ms", "description", "etag", "friendly-name", "id", "kind", "last-modified-time", "project-id", "self-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "dataset-reference", "default-table-expiration-ms", "description", "etag", "friendly-name", "id", "kind", "last-modified-time", "location", "project-id", "self-link"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -386,6 +391,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -422,12 +428,13 @@ impl<'n, 'a> Engine<'n, 'a> { "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-table-expiration-ms" => Some(("defaultTableExpirationMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "friendly-name" => Some(("friendlyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "dataset-reference", "default-table-expiration-ms", "description", "etag", "friendly-name", "id", "kind", "last-modified-time", "project-id", "self-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "dataset-reference", "default-table-expiration-ms", "description", "etag", "friendly-name", "id", "kind", "last-modified-time", "location", "project-id", "self-link"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -480,6 +487,59 @@ impl<'n, 'a> Engine<'n, 'a> { 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 _jobs_cancel(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.jobs().cancel(opt.value_of("project-id").unwrap_or(""), opt.value_of("job-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(()) } } @@ -531,6 +591,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -595,6 +656,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -760,6 +822,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -827,6 +890,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -919,6 +983,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -977,6 +1042,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1063,6 +1129,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1124,6 +1191,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1219,6 +1287,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1318,6 +1387,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1376,6 +1446,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1475,6 +1546,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1574,6 +1646,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1613,6 +1686,9 @@ impl<'n, 'a> Engine<'n, 'a> { }, ("jobs", Some(opt)) => { match opt.subcommand() { + ("cancel", Some(opt)) => { + call_result = self._jobs_cancel(opt, dry_run, &mut err); + }, ("get", Some(opt)) => { call_result = self._jobs_get(opt, dry_run, &mut err); }, @@ -1719,7 +1795,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() @@ -1732,7 +1808,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() @@ -1939,7 +2015,35 @@ fn main() { ]), ]), - ("jobs", "methods: 'get', 'get-query-results', 'insert', 'list' and 'query'", vec![ + ("jobs", "methods: 'cancel', 'get', 'get-query-results', 'insert', 'list' and 'query'", vec![ + ("cancel", + Some(r##"Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully."##), + "Details at http://byron.github.io/google-apis-rs/google_bigquery2_cli/jobs_cancel", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"Project ID of the job to cancel"##), + Some(true), + Some(false)), + + (Some(r##"job-id"##), + None, + Some(r##"Job ID of the job to cancel"##), + 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##"Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role."##), "Details at http://byron.github.io/google-apis-rs/google_bigquery2_cli/jobs_get", @@ -2389,7 +2493,7 @@ fn main() { let mut app = App::new("bigquery2") .author("Sebastian Thiel ") - .version("0.3.0+20150326") + .version("0.3.0+20150526") .about("A data platform for customers to create, manage, share and query data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_bigquery2_cli") .arg(Arg::with_name("url") diff --git a/gen/bigquery2/Cargo.toml b/gen/bigquery2/Cargo.toml index e23c95b4be..c002f48945 100644 --- a/gen/bigquery2/Cargo.toml +++ b/gen/bigquery2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-bigquery2" -version = "0.1.8+20150326" +version = "0.1.8+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with bigquery (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/bigquery2" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/bigquery2/README.md b/gen/bigquery2/README.md index 139cbecbc4..42c9bb04be 100644 --- a/gen/bigquery2/README.md +++ b/gen/bigquery2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-bigquery2` library allows access to all features of the *Google bigquery* service. -This documentation was generated from *bigquery* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *bigquery* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *bigquery* *v2* API can be found at the [official documentation site](https://cloud.google.com/bigquery/). @@ -16,7 +16,7 @@ Handle the following *Resources* with ease from the central [hub](http://byron.g * [datasets](http://byron.github.io/google-apis-rs/google_bigquery2/struct.Dataset.html) * [*delete*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.DatasetDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.DatasetGetCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.DatasetInsertCall.html), [*list*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.DatasetListCall.html), [*patch*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.DatasetPatchCall.html) and [*update*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.DatasetUpdateCall.html) * [jobs](http://byron.github.io/google-apis-rs/google_bigquery2/struct.Job.html) - * [*get*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.JobGetCall.html), [*get query results*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.JobGetQueryResultCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.JobInsertCall.html), [*list*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.JobListCall.html) and [*query*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.JobQueryCall.html) + * [*cancel*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.JobCancelCall.html), [*get*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.JobGetCall.html), [*get query results*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.JobGetQueryResultCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.JobInsertCall.html), [*list*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.JobListCall.html) and [*query*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.JobQueryCall.html) * projects * [*list*](http://byron.github.io/google-apis-rs/google_bigquery2/struct.ProjectListCall.html) * tabledata diff --git a/gen/bigquery2/src/cmn.rs b/gen/bigquery2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/bigquery2/src/cmn.rs +++ b/gen/bigquery2/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/bigquery2/src/lib.rs b/gen/bigquery2/src/lib.rs index d91095b670..303df3bd4e 100644 --- a/gen/bigquery2/src/lib.rs +++ b/gen/bigquery2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *bigquery* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *bigquery* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *bigquery* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/bigquery/). @@ -14,7 +14,7 @@ //! * [datasets](struct.Dataset.html) //! * [*delete*](struct.DatasetDeleteCall.html), [*get*](struct.DatasetGetCall.html), [*insert*](struct.DatasetInsertCall.html), [*list*](struct.DatasetListCall.html), [*patch*](struct.DatasetPatchCall.html) and [*update*](struct.DatasetUpdateCall.html) //! * [jobs](struct.Job.html) -//! * [*get*](struct.JobGetCall.html), [*get query results*](struct.JobGetQueryResultCall.html), [*insert*](struct.JobInsertCall.html), [*list*](struct.JobListCall.html) and [*query*](struct.JobQueryCall.html) +//! * [*cancel*](struct.JobCancelCall.html), [*get*](struct.JobGetCall.html), [*get query results*](struct.JobGetQueryResultCall.html), [*insert*](struct.JobInsertCall.html), [*list*](struct.JobListCall.html) and [*query*](struct.JobQueryCall.html) //! * projects //! * [*list*](struct.ProjectListCall.html) //! * tabledata diff --git a/gen/bigquery2/src/lib.rs.in b/gen/bigquery2/src/lib.rs.in index 035deb64ed..9e8bf437da 100644 --- a/gen/bigquery2/src/lib.rs.in +++ b/gen/bigquery2/src/lib.rs.in @@ -388,6 +388,8 @@ pub struct Dataset { pub default_table_expiration_ms: Option, /// [Output-only] A hash of the resource. pub etag: Option, + /// [Experimental] The location where the data resides. If not present, the data will be stored in the US. + pub location: Option, /// [Optional] A descriptive name for the dataset. #[serde(rename="friendlyName")] pub friendly_name: Option, @@ -422,7 +424,7 @@ impl NestedType for TableDataInsertAllResponseInsertErrors {} impl Part for TableDataInsertAllResponseInsertErrors {} -/// Represents a single cell in the result set. Users of the java client can detect whether their value result is null by calling 'com.google.api.client.util.Data.isNull(cell.getV())'. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -576,11 +578,12 @@ impl ResponseResult for TableDataList {} /// 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*). /// -/// * [insert jobs](struct.JobInsertCall.html) (request|response) -/// * [query jobs](struct.JobQueryCall.html) (none) +/// * [cancel jobs](struct.JobCancelCall.html) (none) /// * [list jobs](struct.JobListCall.html) (none) /// * [get query results jobs](struct.JobGetQueryResultCall.html) (none) +/// * [query jobs](struct.JobQueryCall.html) (none) /// * [get jobs](struct.JobGetCall.html) (response) +/// * [insert jobs](struct.JobInsertCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Job { @@ -680,7 +683,7 @@ pub struct JobConfigurationLoad { /// [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names #[serde(rename="ignoreUnknownValues")] pub ignore_unknown_values: Option, - /// [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. + /// [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_APPEND. 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. #[serde(rename="writeDisposition")] pub write_disposition: Option, /// [Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped. @@ -716,9 +719,6 @@ pub struct JobList { /// A token to request the next page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// Total number of jobs in this collection. - #[serde(rename="totalItems")] - pub total_items: Option, /// The resource type of the response. pub kind: Option, /// A hash of this page of results. @@ -1081,7 +1081,7 @@ pub struct JobConfigurationQuery { /// [Optional] Flattens all nested and repeated fields in the query results. The default value is true. allowLargeResults must be true if this is set to false. #[serde(rename="flattenResults")] pub flatten_results: Option, - /// [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. + /// [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. #[serde(rename="useQueryCache")] pub use_query_cache: Option, /// [Optional] Specifies the default dataset to use for unqualified table names in the query. @@ -1131,13 +1131,13 @@ pub struct DatasetReference { impl Part for DatasetReference {} -/// Represents a single row in the result set, consisting of one or more fields. +/// 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 TableRow { - /// no description provided + /// Represents a single row in the result set, consisting of one or more fields. pub f: Option>, } @@ -1193,6 +1193,26 @@ impl NestedType for ProjectListProjects {} impl Part for ProjectListProjects {} +/// 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*). +/// +/// * [cancel jobs](struct.JobCancelCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct JobCancelResponse { + /// The final state of the job. + pub job: Option, + /// The resource type of the response. + pub kind: Option, +} + +impl ResponseResult for JobCancelResponse {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1722,7 +1742,7 @@ impl<'a, C, A> DatasetMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Bigquery::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get(...)`, `get_query_results(...)`, `insert(...)`, `list(...)` and `query(...)` +/// // like `cancel(...)`, `get(...)`, `get_query_results(...)`, `insert(...)`, `list(...)` and `query(...)` /// // to build up your call. /// let rb = hub.jobs(); /// # } @@ -1737,6 +1757,25 @@ impl<'a, C, A> MethodsBuilder for JobMethods<'a, C, A> {} impl<'a, C, A> JobMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. + /// + /// # Arguments + /// + /// * `projectId` - Project ID of the job to cancel + /// * `jobId` - Job ID of the job to cancel + pub fn cancel(&self, project_id: &str, job_id: &str) -> JobCancelCall<'a, C, A> { + JobCancelCall { + hub: self.hub, + _project_id: project_id.to_string(), + _job_id: job_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout. @@ -5227,6 +5266,254 @@ impl<'a, C, A> DatasetInsertCall<'a, C, A> where C: BorrowMut, A: } +/// Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. +/// +/// A builder for the *cancel* method supported by a *job* resource. +/// It is not used directly, but through a `JobMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigquery2 as bigquery2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigquery2::Bigquery; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Bigquery::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.jobs().cancel("projectId", "jobId") +/// .doit(); +/// # } +/// ``` +pub struct JobCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Bigquery, + _project_id: String, + _job_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for JobCancelCall<'a, C, A> {} + +impl<'a, C, A> JobCancelCall<'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, JobCancelResponse)> { + 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: "bigquery.jobs.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("jobId", self._job_id.to_string())); + for &field in ["alt", "projectId", "jobId"].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://www.googleapis.com/bigquery/v2/project/{projectId}/jobs/{jobId}/cancel".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{jobId}", "jobId")].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(2); + for param_name in ["jobId", "projectId"].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::Post, &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) + } + } + } + } + + + /// Project ID of the job to cancel + /// + /// Sets the *project 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 project_id(mut self, new_value: &str) -> JobCancelCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Job ID of the job to cancel + /// + /// Sets the *job 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 job_id(mut self, new_value: &str) -> JobCancelCall<'a, C, A> { + self._job_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) -> JobCancelCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> JobCancelCall<'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::Full`. + /// + /// 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) -> JobCancelCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout. /// /// A builder for the *query* method supported by a *job* resource. @@ -5521,10 +5808,10 @@ impl<'a, C, A> JobQueryCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.jobs().get_query_results("projectId", "jobId") -/// .timeout_ms(65) -/// .start_index("eirmod") -/// .page_token("dolore") -/// .max_results(64) +/// .timeout_ms(68) +/// .start_index("invidunt") +/// .page_token("aliquyam") +/// .max_results(28) /// .doit(); /// # } /// ``` @@ -5817,11 +6104,11 @@ impl<'a, C, A> JobGetQueryResultCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.jobs().list("projectId") -/// .add_state_filter("accusam") -/// .projection("Lorem") -/// .page_token("sea") +/// .add_state_filter("sea") +/// .projection("et") +/// .page_token("duo") /// .max_results(80) -/// .all_users(false) +/// .all_users(true) /// .doit(); /// # } /// ``` @@ -7037,9 +7324,9 @@ impl<'a, C, A> TabledataInsertAllCall<'a, C, A> where C: BorrowMut TabledataListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().list() -/// .page_token("dolor") -/// .max_results(78) +/// .page_token("consetetur") +/// .max_results(49) /// .doit(); /// # } /// ``` diff --git a/gen/blogger3-cli/Cargo.toml b/gen/blogger3-cli/Cargo.toml index 7fbe133b96..1dfd1be9df 100644 --- a/gen/blogger3-cli/Cargo.toml +++ b/gen/blogger3-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["blogger", "google", "cli"] name = "blogger3" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/blogger3-cli/src/main.rs b/gen/blogger3-cli/src/main.rs index a6a0f7137f..43e2b1b684 100644 --- a/gen/blogger3-cli/src/main.rs +++ b/gen/blogger3-cli/src/main.rs @@ -93,6 +93,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -151,6 +152,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -206,6 +208,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -270,6 +273,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -321,6 +325,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -420,6 +425,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -493,6 +499,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -563,6 +570,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -614,6 +622,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -665,6 +674,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -720,6 +730,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -819,6 +830,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -921,6 +933,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -988,6 +1001,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1093,6 +1107,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1144,6 +1159,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1195,6 +1211,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1300,6 +1317,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1355,6 +1373,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1434,6 +1453,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1542,6 +1562,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1600,6 +1621,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1718,6 +1740,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1800,6 +1823,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1924,6 +1948,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1979,6 +2004,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2030,6 +2056,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2088,6 +2115,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2212,6 +2240,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2263,6 +2292,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2471,7 +2501,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() @@ -2484,7 +2514,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() diff --git a/gen/blogger3/Cargo.toml b/gen/blogger3/Cargo.toml index 682d47b809..8d480001af 100644 --- a/gen/blogger3/Cargo.toml +++ b/gen/blogger3/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/blogger3/src/cmn.rs b/gen/blogger3/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/blogger3/src/cmn.rs +++ b/gen/blogger3/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/books1-cli/Cargo.toml b/gen/books1-cli/Cargo.toml index 26f791bd1f..16a033f388 100644 --- a/gen/books1-cli/Cargo.toml +++ b/gen/books1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-books1-cli" -version = "0.3.0+20150401" +version = "0.3.0+20150318" authors = ["Sebastian Thiel "] description = "A complete library to interact with books (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/books1-cli" @@ -17,8 +17,8 @@ keywords = ["books", "google", "cli"] name = "books1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/books1-cli/README.md b/gen/books1-cli/README.md index 7ad49e9467..bc22901a98 100644 --- a/gen/books1-cli/README.md +++ b/gen/books1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *books* API at revision *20150401*. The CLI is at version *0.3.0*. +This documentation was generated from the *books* API at revision *20150318*. The CLI is at version *0.3.0*. ```bash books1 [options] diff --git a/gen/books1-cli/mkdocs.yml b/gen/books1-cli/mkdocs.yml index b8483aef84..8b070aadb1 100644 --- a/gen/books1-cli/mkdocs.yml +++ b/gen/books1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: books v0.3.0+20150401 +site_name: books v0.3.0+20150318 site_url: http://byron.github.io/google-apis-rs/google-books1-cli site_description: Write integrating applications with bcore diff --git a/gen/books1-cli/src/main.rs b/gen/books1-cli/src/main.rs index d37455f10a..15799dcb20 100644 --- a/gen/books1-cli/src/main.rs +++ b/gen/books1-cli/src/main.rs @@ -93,6 +93,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -148,6 +149,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -212,6 +214,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -276,6 +279,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -407,6 +411,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -458,6 +463,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -528,6 +534,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -610,6 +617,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -668,6 +676,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -732,6 +741,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -790,6 +800,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -878,6 +889,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -929,6 +941,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -987,6 +1000,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1045,6 +1059,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1109,6 +1124,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1195,6 +1211,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1387,6 +1404,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1469,6 +1487,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1520,6 +1539,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1658,6 +1678,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1812,6 +1833,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1867,6 +1889,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2040,6 +2063,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2098,6 +2122,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2210,6 +2235,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2228,6 +2254,9 @@ impl<'n, 'a> Engine<'n, 'a> { "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, + "max-allowed-maturity-rating" => { + call = call.max_allowed_maturity_rating(value.unwrap_or("")); + }, "locale" => { call = call.locale(value.unwrap_or("")); }, @@ -2247,7 +2276,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["locale", "page-token", "category-id", "page-size"].iter().map(|v|*v)); + v.extend(["locale", "page-token", "max-allowed-maturity-rating", "category-id", "page-size"].iter().map(|v|*v)); v } )); } } @@ -2274,6 +2303,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2479,6 +2509,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2494,6 +2525,9 @@ impl<'n, 'a> Engine<'n, 'a> { "source" => { call = call.source(value.unwrap_or("")); }, + "max-allowed-maturity-rating" => { + call = call.max_allowed_maturity_rating(value.unwrap_or("")); + }, "locale" => { call = call.locale(value.unwrap_or("")); }, @@ -2513,7 +2547,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["locale", "source", "association"].iter().map(|v|*v)); + v.extend(["locale", "source", "max-allowed-maturity-rating", "association"].iter().map(|v|*v)); v } )); } } @@ -2540,6 +2574,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2607,6 +2642,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2695,6 +2731,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2765,6 +2802,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2780,6 +2818,9 @@ impl<'n, 'a> Engine<'n, 'a> { "source" => { call = call.source(value.unwrap_or("")); }, + "max-allowed-maturity-rating" => { + call = call.max_allowed_maturity_rating(value.unwrap_or("")); + }, "locale" => { call = call.locale(value.unwrap_or("")); }, @@ -2796,7 +2837,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["locale", "source"].iter().map(|v|*v)); + v.extend(["locale", "source", "max-allowed-maturity-rating"].iter().map(|v|*v)); v } )); } } @@ -2823,6 +2864,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2881,6 +2923,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2951,6 +2994,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3200,7 +3244,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() @@ -3213,7 +3257,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() @@ -4283,7 +4327,7 @@ fn main() { let mut app = App::new("books1") .author("Sebastian Thiel ") - .version("0.3.0+20150401") + .version("0.3.0+20150318") .about("Lets you search for books and manage your Google Books library.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_books1_cli") .arg(Arg::with_name("url") diff --git a/gen/books1/Cargo.toml b/gen/books1/Cargo.toml index 51e704b4e5..b8991bae76 100644 --- a/gen/books1/Cargo.toml +++ b/gen/books1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-books1" -version = "0.1.8+20150401" +version = "0.1.8+20150318" authors = ["Sebastian Thiel "] description = "A complete library to interact with books (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/books1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/books1/README.md b/gen/books1/README.md index 1a8dcd53a3..d198556204 100644 --- a/gen/books1/README.md +++ b/gen/books1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-books1` library allows access to all features of the *Google books* service. -This documentation was generated from *books* crate version *0.1.8+20150401*, where *20150401* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *books* crate version *0.1.8+20150318*, where *20150318* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *books* *v1* API can be found at the [official documentation site](https://developers.google.com/books/docs/v1/getting_started). diff --git a/gen/books1/src/cmn.rs b/gen/books1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/books1/src/cmn.rs +++ b/gen/books1/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/books1/src/lib.rs b/gen/books1/src/lib.rs index e1b5616e89..a7a8c7904e 100644 --- a/gen/books1/src/lib.rs +++ b/gen/books1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *books* crate version *0.1.8+20150401*, where *20150401* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *books* crate version *0.1.8+20150318*, where *20150318* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *books* *v1* API can be found at the //! [official documentation site](https://developers.google.com/books/docs/v1/getting_started). @@ -117,18 +117,18 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.volumes().list("q") -//! .start_index(76) -//! .source("consetetur") -//! .show_preorders(true) -//! .projection("justo") -//! .print_type("tempor") -//! .partner("gubergren") -//! .order_by("dolore") -//! .max_results(50) -//! .library_restrict("dolore") -//! .lang_restrict("magna") -//! .filter("elitr") -//! .download("magna") +//! .start_index(80) +//! .source("tempor") +//! .show_preorders(false) +//! .projection("dolore") +//! .print_type("amet.") +//! .partner("dolore") +//! .order_by("magna") +//! .max_results(7) +//! .library_restrict("magna") +//! .lang_restrict("ipsum") +//! .filter("invidunt") +//! .download("accusam") //! .doit(); //! //! match result { diff --git a/gen/books1/src/lib.rs.in b/gen/books1/src/lib.rs.in index 054a3e040e..b7df848718 100644 --- a/gen/books1/src/lib.rs.in +++ b/gen/books1/src/lib.rs.in @@ -318,6 +318,9 @@ pub struct VolumeVolumeInfo { /// no description provided #[serde(rename="maturityRating")] pub maturity_rating: Option, + /// URL to view information about this volume on the Google Books site. (In LITE projection) + #[serde(rename="infoLink")] + pub info_link: Option, /// Date of publication. (In LITE projection.) #[serde(rename="publishedDate")] pub published_date: Option, @@ -344,9 +347,9 @@ pub struct VolumeVolumeInfo { /// The mean review rating for this volume. (min = 1.0, max = 5.0) #[serde(rename="averageRating")] pub average_rating: Option, - /// URL to view information about this volume on the Google Books site. (In LITE projection) - #[serde(rename="infoLink")] - pub info_link: Option, + /// Whether anonymous logging should be allowed. + #[serde(rename="allowAnonLogging")] + pub allow_anon_logging: Option, /// Canonical URL for a volume. (In LITE projection.) #[serde(rename="canonicalVolumeLink")] pub canonical_volume_link: Option, @@ -2163,6 +2166,7 @@ impl<'a, C, A> VolumeMethods<'a, C, A> { hub: self.hub, _volume_id: volume_id.to_string(), _source: Default::default(), + _max_allowed_maturity_rating: Default::default(), _locale: Default::default(), _association: Default::default(), _delegate: Default::default(), @@ -2200,6 +2204,7 @@ impl<'a, C, A> VolumeMethods<'a, C, A> { VolumeRecommendedListCall { hub: self.hub, _source: Default::default(), + _max_allowed_maturity_rating: Default::default(), _locale: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2527,6 +2532,7 @@ impl<'a, C, A> OnboardingMethods<'a, C, A> { hub: self.hub, _page_token: Default::default(), _page_size: Default::default(), + _max_allowed_maturity_rating: Default::default(), _locale: Default::default(), _category_id: Default::default(), _delegate: Default::default(), @@ -6278,8 +6284,9 @@ impl<'a, C, A> VolumeUseruploadedListCall<'a, C, A> where C: BorrowMut hub: &'a Books, _volume_id: String, _source: Option, + _max_allowed_maturity_rating: Option, _locale: Option, _association: Option, _delegate: Option<&'a mut Delegate>, @@ -6312,18 +6320,21 @@ impl<'a, C, A> VolumeAssociatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); params.push(("volumeId", self._volume_id.to_string())); if let Some(value) = self._source { params.push(("source", value.to_string())); } + if let Some(value) = self._max_allowed_maturity_rating { + params.push(("maxAllowedMaturityRating", value.to_string())); + } if let Some(value) = self._locale { params.push(("locale", value.to_string())); } if let Some(value) = self._association { params.push(("association", value.to_string())); } - for &field in ["alt", "volumeId", "source", "locale", "association"].iter() { + for &field in ["alt", "volumeId", "source", "maxAllowedMaturityRating", "locale", "association"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6456,6 +6467,13 @@ impl<'a, C, A> VolumeAssociatedListCall<'a, C, A> where C: BorrowMut VolumeAssociatedListCall<'a, C, A> { + self._max_allowed_maturity_rating = Some(new_value.to_string()); + self + } /// ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. /// /// Sets the *locale* query property to the given value. @@ -6549,11 +6567,11 @@ impl<'a, C, A> VolumeAssociatedListCall<'a, C, A> where C: BorrowMut VolumeGetCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.volumes().recommended_list() -/// .source("dolores") -/// .locale("sit") +/// .source("sit") +/// .max_allowed_maturity_rating("diam") +/// .locale("ut") /// .doit(); /// # } /// ``` @@ -6854,6 +6873,7 @@ pub struct VolumeRecommendedListCall<'a, C, A> hub: &'a Books, _source: Option, + _max_allowed_maturity_rating: Option, _locale: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -6876,14 +6896,17 @@ impl<'a, C, A> VolumeRecommendedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((4 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); if let Some(value) = self._source { params.push(("source", value.to_string())); } + if let Some(value) = self._max_allowed_maturity_rating { + params.push(("maxAllowedMaturityRating", value.to_string())); + } if let Some(value) = self._locale { params.push(("locale", value.to_string())); } - for &field in ["alt", "source", "locale"].iter() { + for &field in ["alt", "source", "maxAllowedMaturityRating", "locale"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6985,6 +7008,13 @@ impl<'a, C, A> VolumeRecommendedListCall<'a, C, A> where C: BorrowMut VolumeRecommendedListCall<'a, C, A> { + self._max_allowed_maturity_rating = Some(new_value.to_string()); + self + } /// ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. /// /// Sets the *locale* query property to the given value. @@ -7286,10 +7316,10 @@ impl<'a, C, A> DictionaryListOfflineMetadataCall<'a, C, A> where C: BorrowMut BookshelveVolumeListCall<'a, C, A> where C: BorrowMut BookshelveListCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.bookshelves().get("userId", "shelf") -/// .source("invidunt") +/// .source("dolores") /// .doit(); /// # } /// ``` @@ -8090,14 +8120,14 @@ impl<'a, C, A> BookshelveGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.promooffer().accept() -/// .volume_id("ut") -/// .serial("dolores") -/// .product("eos") -/// .offer_id("voluptua.") -/// .model("duo") -/// .manufacturer("sed") -/// .device("aliquyam") -/// .android_id("ea") +/// .volume_id("eos") +/// .serial("voluptua.") +/// .product("duo") +/// .offer_id("sed") +/// .model("aliquyam") +/// .manufacturer("ea") +/// .device("ea") +/// .android_id("et") /// .doit(); /// # } /// ``` @@ -8377,13 +8407,13 @@ impl<'a, C, A> PromoofferAcceptCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.promooffer().dismiss() -/// .serial("ea") -/// .product("et") -/// .offer_id("dolor") -/// .model("diam") -/// .manufacturer("kasd") -/// .device("invidunt") -/// .android_id("rebum.") +/// .serial("dolor") +/// .product("diam") +/// .offer_id("kasd") +/// .model("invidunt") +/// .manufacturer("rebum.") +/// .device("Lorem") +/// .android_id("clita") /// .doit(); /// # } /// ``` @@ -8653,12 +8683,12 @@ impl<'a, C, A> PromoofferDismisCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.promooffer().get() -/// .serial("Lorem") -/// .product("clita") -/// .model("invidunt") -/// .manufacturer("eirmod") -/// .device("At") -/// .android_id("consetetur") +/// .serial("invidunt") +/// .product("eirmod") +/// .model("At") +/// .manufacturer("consetetur") +/// .device("et") +/// .android_id("sed") /// .doit(); /// # } /// ``` @@ -8928,7 +8958,7 @@ impl<'a, C, A> PromoofferGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.onboarding().list_categories() -/// .locale("et") +/// .locale("sit") /// .doit(); /// # } /// ``` @@ -9143,10 +9173,11 @@ impl<'a, C, A> OnboardingListCategoryCall<'a, C, A> where C: BorrowMut hub: &'a Books, _page_token: Option, _page_size: Option, + _max_allowed_maturity_rating: Option, _locale: Option, _category_id: Vec, _delegate: Option<&'a mut Delegate>, @@ -9179,13 +9211,16 @@ impl<'a, C, A> OnboardingListCategoryVolumeCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); 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._max_allowed_maturity_rating { + params.push(("maxAllowedMaturityRating", value.to_string())); + } if let Some(value) = self._locale { params.push(("locale", value.to_string())); } @@ -9196,7 +9231,7 @@ impl<'a, C, A> OnboardingListCategoryVolumeCall<'a, C, A> where C: BorrowMut OnboardingListCategoryVolumeCall<'a, C, A> where C: BorrowMut OnboardingListCategoryVolumeCall<'a, C, A> { + self._max_allowed_maturity_rating = Some(new_value.to_string()); + self + } /// ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. /// /// Sets the *locale* query property to the given value. @@ -9399,8 +9441,8 @@ impl<'a, C, A> OnboardingListCategoryVolumeCall<'a, C, A> where C: BorrowMut MyconfigRequestAccesCall<'a, C, A> where C: BorrowMut MyconfigReleaseDownloadAccesCall<'a, C, A> where C: BorrowMut MyconfigUpdateUserSettingCall<'a, C, A> where C: BorrowMut MylibraryBookshelveClearVolumeCall<'a, C, A> where C: BorrowMut MylibraryBookshelveMoveVolumeCall<'a, C, A> where C: BorrowMut MylibraryAnnotationSummaryCall<'a, C, A> where C: BorrowMut MylibraryAnnotationDeleteCall<'a, C, A> where C: BorrowMut MylibraryBookshelveAddVolumeCall<'a, C, A> where C: BorrowMut MylibraryAnnotationInsertCall<'a, C, A> where C: BorrowMut MylibraryBookshelveRemoveVolumeCall<'a, C, A> where C: BorrowMut< /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.mylibrary().annotations_list() -/// .volume_id("accusam") -/// .updated_min("dolores") -/// .updated_max("consetetur") -/// .source("dolor") -/// .show_deleted(false) -/// .page_token("elitr") -/// .max_results(85) -/// .add_layer_ids("et") -/// .layer_id("Stet") -/// .content_version("sed") +/// .volume_id("dolor") +/// .updated_min("aliquyam") +/// .updated_max("elitr") +/// .source("ea") +/// .show_deleted(true) +/// .page_token("Stet") +/// .max_results(58) +/// .add_layer_ids("dolor") +/// .layer_id("sanctus") +/// .content_version("dolore") /// .doit(); /// # } /// ``` @@ -13081,7 +13123,7 @@ impl<'a, C, A> MylibraryAnnotationListCall<'a, C, A> where C: BorrowMut MylibraryAnnotationUpdateCall<'a, C, A> where C: BorrowMut MylibraryReadingpositionSetPositionCall<'a, C, A> where C: Borrow /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.mylibrary().bookshelves_get("shelf") -/// .source("sadipscing") +/// .source("Lorem") /// .doit(); /// # } /// ``` @@ -13899,7 +13941,7 @@ impl<'a, C, A> MylibraryBookshelveGetCall<'a, C, A> where C: BorrowMut MylibraryBookshelveListCall<'a, C, A> where C: BorrowMut MylibraryReadingpositionGetCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with calendar (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/calendar3-cli" @@ -17,8 +17,8 @@ keywords = ["calendar", "google", "cli"] name = "calendar3" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/calendar3-cli/README.md b/gen/calendar3-cli/README.md index 494d05739d..c1c189b399 100644 --- a/gen/calendar3-cli/README.md +++ b/gen/calendar3-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *calendar* API at revision *20150326*. The CLI is at version *0.3.0*. +This documentation was generated from the *calendar* API at revision *20150408*. The CLI is at version *0.3.0*. ```bash calendar3 [options] diff --git a/gen/calendar3-cli/mkdocs.yml b/gen/calendar3-cli/mkdocs.yml index 2d40a084c8..6108ebf1b0 100644 --- a/gen/calendar3-cli/mkdocs.yml +++ b/gen/calendar3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: calendar v0.3.0+20150326 +site_name: calendar v0.3.0+20150408 site_url: http://byron.github.io/google-apis-rs/google-calendar3-cli site_description: Write integrating applications with bcore diff --git a/gen/calendar3-cli/src/main.rs b/gen/calendar3-cli/src/main.rs index eb16e0d4f0..54f5208732 100644 --- a/gen/calendar3-cli/src/main.rs +++ b/gen/calendar3-cli/src/main.rs @@ -133,6 +133,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -222,6 +223,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -286,6 +288,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -375,6 +378,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -464,6 +468,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -570,6 +575,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -665,6 +671,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -768,6 +775,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -838,6 +846,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -941,6 +950,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1044,6 +1054,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1156,6 +1167,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1295,6 +1307,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1385,6 +1398,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1475,6 +1489,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1565,6 +1580,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1702,6 +1718,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1811,6 +1828,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1950,6 +1968,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2096,6 +2115,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2175,6 +2195,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2278,6 +2299,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2333,6 +2355,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2482,6 +2505,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2537,6 +2561,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2686,6 +2711,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2831,6 +2857,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2919,6 +2946,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2970,6 +2998,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3031,6 +3060,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3134,6 +3164,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3354,7 +3385,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() @@ -3367,7 +3398,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() @@ -4340,7 +4371,7 @@ fn main() { let mut app = App::new("calendar3") .author("Sebastian Thiel ") - .version("0.3.0+20150326") + .version("0.3.0+20150408") .about("Lets you manipulate events and other calendar data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_calendar3_cli") .arg(Arg::with_name("url") diff --git a/gen/calendar3/Cargo.toml b/gen/calendar3/Cargo.toml index 81e44d2451..22e779e7f1 100644 --- a/gen/calendar3/Cargo.toml +++ b/gen/calendar3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-calendar3" -version = "0.1.8+20150326" +version = "0.1.8+20150408" authors = ["Sebastian Thiel "] description = "A complete library to interact with calendar (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/calendar3" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/calendar3/README.md b/gen/calendar3/README.md index 9c0681ffca..df7e5611ea 100644 --- a/gen/calendar3/README.md +++ b/gen/calendar3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-calendar3` library allows access to all features of the *Google calendar* service. -This documentation was generated from *calendar* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *calendar* crate version *0.1.8+20150408*, where *20150408* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *calendar* *v3* API can be found at the [official documentation site](https://developers.google.com/google-apps/calendar/firstapp). diff --git a/gen/calendar3/src/cmn.rs b/gen/calendar3/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/calendar3/src/cmn.rs +++ b/gen/calendar3/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/calendar3/src/lib.rs b/gen/calendar3/src/lib.rs index b9ed1f1e12..bdff40849e 100644 --- a/gen/calendar3/src/lib.rs +++ b/gen/calendar3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *calendar* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *calendar* crate version *0.1.8+20150408*, where *20150408* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *calendar* *v3* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/calendar/firstapp). diff --git a/gen/calendar3/src/lib.rs.in b/gen/calendar3/src/lib.rs.in index 0530bcf5fa..f53dc9b4c0 100644 --- a/gen/calendar3/src/lib.rs.in +++ b/gen/calendar3/src/lib.rs.in @@ -4131,7 +4131,7 @@ impl<'a, C, A> CalendarListListCall<'a, C, A> where C: BorrowMut, self._page_token = Some(new_value.to_string()); self } - /// The minimum access role for the user in the returned entires. Optional. The default is no restriction. + /// The minimum access role for the user in the returned entries. Optional. The default is no restriction. /// /// Sets the *min access role* query property to the given value. pub fn min_access_role(mut self, new_value: &str) -> CalendarListListCall<'a, C, A> { @@ -4966,7 +4966,7 @@ impl<'a, C, A> CalendarListWatchCall<'a, C, A> where C: BorrowMut self._page_token = Some(new_value.to_string()); self } - /// The minimum access role for the user in the returned entires. Optional. The default is no restriction. + /// The minimum access role for the user in the returned entries. Optional. The default is no restriction. /// /// Sets the *min access role* query property to the given value. pub fn min_access_role(mut self, new_value: &str) -> CalendarListWatchCall<'a, C, A> { diff --git a/gen/civicinfo2-cli/Cargo.toml b/gen/civicinfo2-cli/Cargo.toml index d3275d985c..7ddd5d1223 100644 --- a/gen/civicinfo2-cli/Cargo.toml +++ b/gen/civicinfo2-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["civicinfo", "google", "cli"] name = "civicinfo2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/civicinfo2-cli/src/main.rs b/gen/civicinfo2-cli/src/main.rs index 9a07cec5ab..19ab1b60e8 100644 --- a/gen/civicinfo2-cli/src/main.rs +++ b/gen/civicinfo2-cli/src/main.rs @@ -90,6 +90,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -138,6 +139,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -193,6 +195,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -254,6 +257,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -312,6 +316,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -396,7 +401,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() @@ -409,7 +414,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() diff --git a/gen/civicinfo2/Cargo.toml b/gen/civicinfo2/Cargo.toml index 7dbb3b3740..52f1ba508f 100644 --- a/gen/civicinfo2/Cargo.toml +++ b/gen/civicinfo2/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/civicinfo2/src/cmn.rs b/gen/civicinfo2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/civicinfo2/src/cmn.rs +++ b/gen/civicinfo2/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/cloudlatencytest2-cli/Cargo.toml b/gen/cloudlatencytest2-cli/Cargo.toml index ce4572add0..5ef505feae 100644 --- a/gen/cloudlatencytest2-cli/Cargo.toml +++ b/gen/cloudlatencytest2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudlatencytest2-cli" -version = "0.3.0+20150206" +version = "0.3.0+20150508" authors = ["Sebastian Thiel "] description = "A complete library to interact with cloudlatencytest (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudlatencytest2-cli" @@ -16,8 +16,8 @@ keywords = ["cloudlatencytest", "google", "cli"] name = "cloudlatencytest2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/cloudlatencytest2-cli/README.md b/gen/cloudlatencytest2-cli/README.md index cbfba653c2..a3a876efad 100644 --- a/gen/cloudlatencytest2-cli/README.md +++ b/gen/cloudlatencytest2-cli/README.md @@ -21,7 +21,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *cloudlatencytest* API at revision *20150206*. The CLI is at version *0.3.0*. +This documentation was generated from the *cloudlatencytest* API at revision *20150508*. The CLI is at version *0.3.0*. ```bash cloudlatencytest2 [options] diff --git a/gen/cloudlatencytest2-cli/mkdocs.yml b/gen/cloudlatencytest2-cli/mkdocs.yml index e7c5c09aca..573ae0a1b0 100644 --- a/gen/cloudlatencytest2-cli/mkdocs.yml +++ b/gen/cloudlatencytest2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: cloudlatencytest v0.3.0+20150206 +site_name: cloudlatencytest v0.3.0+20150508 site_url: http://byron.github.io/google-apis-rs/google-cloudlatencytest2-cli site_description: Write integrating applications with bcore diff --git a/gen/cloudlatencytest2-cli/src/main.rs b/gen/cloudlatencytest2-cli/src/main.rs index 94147c2e4b..516af92b58 100644 --- a/gen/cloudlatencytest2-cli/src/main.rs +++ b/gen/cloudlatencytest2-cli/src/main.rs @@ -121,6 +121,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -205,6 +206,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -264,7 +266,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() @@ -277,7 +279,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() @@ -363,7 +365,7 @@ fn main() { let mut app = App::new("cloudlatencytest2") .author("Sebastian Thiel ") - .version("0.3.0+20150206") + .version("0.3.0+20150508") .about("A Test API to report latency data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudlatencytest2_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudlatencytest2/Cargo.toml b/gen/cloudlatencytest2/Cargo.toml index 70a77baeb7..5bfeb20eef 100644 --- a/gen/cloudlatencytest2/Cargo.toml +++ b/gen/cloudlatencytest2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudlatencytest2" -version = "0.1.8+20150206" +version = "0.1.8+20150508" authors = ["Sebastian Thiel "] description = "A complete library to interact with cloudlatencytest (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudlatencytest2" @@ -15,8 +15,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/cloudlatencytest2/README.md b/gen/cloudlatencytest2/README.md index a96560c03a..efb535e049 100644 --- a/gen/cloudlatencytest2/README.md +++ b/gen/cloudlatencytest2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-cloudlatencytest2` library allows access to all features of the *Google cloudlatencytest* service. -This documentation was generated from *cloudlatencytest* crate version *0.1.8+20150206*, where *20150206* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *cloudlatencytest* crate version *0.1.8+20150508*, where *20150508* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. # Features Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_cloudlatencytest2/struct.Cloudlatencytest.html) ... diff --git a/gen/cloudlatencytest2/src/cmn.rs b/gen/cloudlatencytest2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/cloudlatencytest2/src/cmn.rs +++ b/gen/cloudlatencytest2/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/cloudlatencytest2/src/lib.rs b/gen/cloudlatencytest2/src/lib.rs index 210d9a63bc..a69569dda6 100644 --- a/gen/cloudlatencytest2/src/lib.rs +++ b/gen/cloudlatencytest2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *cloudlatencytest* crate version *0.1.8+20150206*, where *20150206* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *cloudlatencytest* crate version *0.1.8+20150508*, where *20150508* is the exact revision of the *cloudlatencytest:v2* 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/cloudlatencytest2). //! # Features //! diff --git a/gen/cloudmonitoring2_beta2-cli/Cargo.toml b/gen/cloudmonitoring2_beta2-cli/Cargo.toml index 579d892c3a..eaf41d6368 100644 --- a/gen/cloudmonitoring2_beta2-cli/Cargo.toml +++ b/gen/cloudmonitoring2_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudmonitoring2_beta2-cli" -version = "0.3.0+20150401" +version = "0.3.0+20150616" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Monitoring (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudmonitoring2_beta2-cli" @@ -17,8 +17,8 @@ keywords = ["cloudmonitoring", "google", "cli"] name = "cloudmonitoring2-beta2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/cloudmonitoring2_beta2-cli/README.md b/gen/cloudmonitoring2_beta2-cli/README.md index 4c14673585..fd56086422 100644 --- a/gen/cloudmonitoring2_beta2-cli/README.md +++ b/gen/cloudmonitoring2_beta2-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Monitoring* API at revision *20150401*. The CLI is at version *0.3.0*. +This documentation was generated from the *Cloud Monitoring* API at revision *20150616*. The CLI is at version *0.3.0*. ```bash cloudmonitoring2-beta2 [options] diff --git a/gen/cloudmonitoring2_beta2-cli/mkdocs.yml b/gen/cloudmonitoring2_beta2-cli/mkdocs.yml index 5e6ad4be80..8923a3cb1a 100644 --- a/gen/cloudmonitoring2_beta2-cli/mkdocs.yml +++ b/gen/cloudmonitoring2_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Monitoring v0.3.0+20150401 +site_name: Cloud Monitoring v0.3.0+20150616 site_url: http://byron.github.io/google-apis-rs/google-cloudmonitoring2_beta2-cli site_description: Write integrating applications with bcore diff --git a/gen/cloudmonitoring2_beta2-cli/src/main.rs b/gen/cloudmonitoring2_beta2-cli/src/main.rs index 46a7074a62..c9a1a65747 100644 --- a/gen/cloudmonitoring2_beta2-cli/src/main.rs +++ b/gen/cloudmonitoring2_beta2-cli/src/main.rs @@ -126,6 +126,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -177,6 +178,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -271,6 +273,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -377,6 +380,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -461,6 +465,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -567,6 +572,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -654,7 +660,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() @@ -667,7 +673,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() @@ -907,7 +913,7 @@ fn main() { let mut app = App::new("cloudmonitoring2-beta2") .author("Sebastian Thiel ") - .version("0.3.0+20150401") + .version("0.3.0+20150616") .about("API for accessing Google Cloud and API monitoring data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudmonitoring2_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudmonitoring2_beta2/Cargo.toml b/gen/cloudmonitoring2_beta2/Cargo.toml index b85299b841..87b4f1d64f 100644 --- a/gen/cloudmonitoring2_beta2/Cargo.toml +++ b/gen/cloudmonitoring2_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudmonitoring2_beta2" -version = "0.1.8+20150401" +version = "0.1.8+20150616" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Monitoring (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudmonitoring2_beta2" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/cloudmonitoring2_beta2/README.md b/gen/cloudmonitoring2_beta2/README.md index a55c607097..ec55c2e3f2 100644 --- a/gen/cloudmonitoring2_beta2/README.md +++ b/gen/cloudmonitoring2_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-cloudmonitoring2_beta2` library allows access to all features of the *Google Cloud Monitoring* service. -This documentation was generated from *Cloud Monitoring* crate version *0.1.8+20150401*, where *20150401* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Cloud Monitoring* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *Cloud Monitoring* *v2_beta2* API can be found at the [official documentation site](https://cloud.google.com/monitoring/v2beta2/). diff --git a/gen/cloudmonitoring2_beta2/src/cmn.rs b/gen/cloudmonitoring2_beta2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/cloudmonitoring2_beta2/src/cmn.rs +++ b/gen/cloudmonitoring2_beta2/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/cloudmonitoring2_beta2/src/lib.rs b/gen/cloudmonitoring2_beta2/src/lib.rs index 0c64eb9c46..19861d35c0 100644 --- a/gen/cloudmonitoring2_beta2/src/lib.rs +++ b/gen/cloudmonitoring2_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Monitoring* crate version *0.1.8+20150401*, where *20150401* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Cloud Monitoring* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *Cloud Monitoring* *v2_beta2* API can be found at the //! [official documentation site](https://cloud.google.com/monitoring/v2beta2/). diff --git a/gen/cloudresourcemanager1_beta1-cli/Cargo.toml b/gen/cloudresourcemanager1_beta1-cli/Cargo.toml new file mode 100644 index 0000000000..d7e5b87cb7 --- /dev/null +++ b/gen/cloudresourcemanager1_beta1-cli/Cargo.toml @@ -0,0 +1,34 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-cloudresourcemanager1_beta1-cli" +version = "0.3.0+20150603" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with cloudresourcemanager (protocol v1beta1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1_beta1-cli" +homepage = "https://cloud.google.com/resource-manager" +documentation = "http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1_cli" +license = "MIT" +keywords = ["cloudresourcemanager", "google", "cli"] + +[[bin]] +name = "cloudresourcemanager1-beta1" + +[dependencies] +hyper = ">= 0.6.0" +mime = "0.0.12" +serde = ">= 0.4.1" +yup-oauth2 = "*" +strsim = "*" +yup-hyper-mock = ">=1.0.0" +clap = ">= 0.9.1" + +[build-dependencies] +syntex = { version = "*" } +serde_codegen = { version = "*" } + + +[dependencies.google-cloudresourcemanager1_beta1] +path = "../cloudresourcemanager1_beta1" diff --git a/gen/cloudresourcemanager1_beta1-cli/LICENSE.md b/gen/cloudresourcemanager1_beta1-cli/LICENSE.md new file mode 100644 index 0000000000..ae22e6ec52 --- /dev/null +++ b/gen/cloudresourcemanager1_beta1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015` `Sebastian Thiel` + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the “Software”), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/gen/cloudresourcemanager1_beta1-cli/README.md b/gen/cloudresourcemanager1_beta1-cli/README.md new file mode 100644 index 0000000000..ea9c81b4b3 --- /dev/null +++ b/gen/cloudresourcemanager1_beta1-cli/README.md @@ -0,0 +1,118 @@ + +The `cloudresourcemanager1-beta1` command-line interface *(CLI)* allows to use most features of the *Google cloudresourcemanager* service from the comfort of your terminal. + +By default all output is printed to standard out, but flags can be set to direct it into a file independent of your shell's +capabilities. Errors will be printed to standard error, and cause the program's exit code to be non-zero. + +If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. + +Everything else about the *cloudresourcemanager* API can be found at the +[official documentation site](https://cloud.google.com/resource-manager). + +# Downloads + +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/cloudresourcemanager1-beta1.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/cloudresourcemanager1-beta1.tar.gz) + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1_beta1-cli). + +# Usage + +This documentation was generated from the *cloudresourcemanager* API at revision *20150603*. The CLI is at version *0.3.0*. + +```bash +cloudresourcemanager1-beta1 [options] + projects + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + list [-p ]... [-o ] + undelete [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + cloudresourcemanager1-beta1 --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. + [default: ~/.google-service-cli] + --debug + Output all server communication to standard error. `tx` and `rx` are placed + into the same stream. + --debug-auth + Output all communication related to authentication to standard error. `tx` + and `rx` are placed into the same stream. + +``` + +# Configuration + +The program will store all persistent data in the `~/.google-service-cli` directory in *JSON* files prefixed with `cloudresourcemanager1-beta1-`. You can change the directory used to store configuration with the `--config-dir` flag on a per-invocation basis. + +More information about the various kinds of persistent data are given in the following paragraphs. + +# Authentication + +Most APIs require a user to authenticate any request. If this is the case, the [scope][scopes] determines the +set of permissions granted. The granularity of these is usually no more than *read-only* or *full-access*. + +If not set, the system will automatically select the smallest feasible scope, e.g. when invoking a +method that is read-only, it will ask only for a read-only scope. +You may use the `--scope` flag to specify a scope directly. +All applicable scopes are documented in the respective method's CLI documentation. + +The first time a scope is used, the user is asked for permission. Follow the instructions given +by the CLI to grant permissions, or to decline. + +If a scope was authenticated by the user, the respective information will be stored as *JSON* in the configuration +directory, e.g. `~/.google-service-cli/cloudresourcemanager1-beta1-token-.json`. No manual management of these tokens +is necessary. + +To revoke granted authentication, please refer to the [official documentation][revoke-access]. + +# Application Secrets + +In order to allow any application to use Google services, it will need to be registered using the +[Google Developer Console][google-dev-console]. APIs the application may use are then enabled for it +one by one. Most APIs can be used for free and have a daily quota. + +To allow more comfortable usage of the CLI without forcing anyone to register an own application, the CLI +comes with a default application secret that is configured accordingly. This also means that heavy usage +all around the world may deplete the daily quota. + +You can workaround this limitation by putting your own secrets file at this location: +`~/.google-service-cli/cloudresourcemanager1-beta1-secret.json`, assuming that the required *cloudresourcemanager* API +was enabled for it. Such a secret file can be downloaded in the *Google Developer Console* at +*APIs & auth -> Credentials -> Download JSON* and used as is. + +Learn more about how to setup Google projects and enable APIs using the [official documentation][google-project-new]. + + +# Debugging + +Even though the CLI does its best to provide usable error messages, sometimes it might be desirable to know +what exactly led to a particular issue. This is done by allowing all client-server communication to be +output to standard error *as-is*. + +The `--debug` flag will print all client-server communication to standard error, whereas the `--debug-auth` flag +will cause all communication related to authentication to standard error. +If the `--debug` flag is set, error-results will be debug-printed, possibly yielding more information about the +issue at hand. + +You may consider redirecting standard error into a file for ease of use, e.g. `cloudresourcemanager1-beta1 --debug [options] 2>debug.txt`. + + +[scopes]: https://developers.google.com/+/api/oauth#scopes +[revoke-access]: http://webapps.stackexchange.com/a/30849 +[google-dev-console]: https://console.developers.google.com/ +[google-project-new]: https://developers.google.com/console/help/new/ \ No newline at end of file diff --git a/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml b/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml new file mode 100644 index 0000000000..3ddc4605b3 --- /dev/null +++ b/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml @@ -0,0 +1,22 @@ +site_name: cloudresourcemanager v0.3.0+20150603 +site_url: http://byron.github.io/google-apis-rs/google-cloudresourcemanager1_beta1-cli +site_description: Write integrating applications with bcore + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1_beta1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_create.md', 'Projects', 'Create'] +- ['projects_delete.md', 'Projects', 'Delete'] +- ['projects_get.md', 'Projects', 'Get'] +- ['projects_list.md', 'Projects', 'List'] +- ['projects_undelete.md', 'Projects', 'Undelete'] +- ['projects_update.md', 'Projects', 'Update'] + +theme: readthedocs + +copyright: Copyright © 2015, `Sebastian Thiel` + diff --git a/gen/cloudresourcemanager1_beta1-cli/src/cmn.rs b/gen/cloudresourcemanager1_beta1-cli/src/cmn.rs new file mode 100644 index 0000000000..56051cab08 --- /dev/null +++ b/gen/cloudresourcemanager1_beta1-cli/src/cmn.rs @@ -0,0 +1,718 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde::json; +use serde::json::value::Value; +use mime::Mime; +use clap::{App, SubCommand}; +use strsim; + +use std::fs; +use std::env; +use std::io; +use std::fmt; +use std::path::{Path, PathBuf}; +use std::str::FromStr; +use std::string::ToString; +use std::io::{Write, Read, stdout}; + +use std::default::Default; + +const FIELD_SEP: char = '.'; + + +pub enum ComplexType { + Pod, + Vec, + Map, +} + + // Null, + // Bool(bool), + // I64(i64), + // U64(u64), + // F64(f64), + // String(String), + +pub enum JsonType { + Boolean, + Int, + Uint, + Float, + String, +} + +pub struct JsonTypeInfo { + pub jtype: JsonType, + pub ctype: ComplexType, +} + +// Based on @erickt user comment. Thanks for the idea ! +// Remove all keys whose values are null from given value (changed in place) +pub fn remove_json_null_values(value: &mut Value) { + match *value { + Value::Object(ref mut map) => { + let mut for_removal = Vec::new(); + + for (key, mut value) in map.iter_mut() { + if value.is_null() { + for_removal.push(key.clone()); + } else { + remove_json_null_values(&mut value); + } + } + + for key in &for_removal { + map.remove(key); + } + } + _ => {} + } +} + +fn did_you_mean<'a>(v: &str, possible_values: &[&'a str]) -> Option<&'a str> { + + let mut candidate: Option<(f64, &str)> = None; + for pv in possible_values { + let confidence = strsim::jaro_winkler(v, pv); + if confidence > 0.8 && (candidate.is_none() || (candidate.as_ref().unwrap().0 < confidence)) { + candidate = Some((confidence, pv)); + } + } + match candidate { + None => None, + Some((_, candidate)) => Some(candidate), + } +} + +pub enum CallType { + Upload(UploadProtocol), + Standard, +} + +arg_enum!{ + pub enum UploadProtocol { + Simple, + Resumable + } +} + +impl AsRef for UploadProtocol { + fn as_ref(&self) -> &str { + match *self { + UploadProtocol::Simple => "simple", + UploadProtocol::Resumable => "resumable" + } + } +} + +impl AsRef for CallType { + fn as_ref(&self) -> &str { + match *self { + CallType::Upload(ref proto) => proto.as_ref(), + CallType::Standard => "standard-request" + } + } +} + +#[derive(Clone, Default)] +pub struct FieldCursor(Vec); + +impl ToString for FieldCursor { + fn to_string(&self) -> String { + self.0.connect(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +impl FieldCursor { + pub fn set(&mut self, value: &str) -> Result<(), CLIError> { + if value.len() == 0 { + return Err(CLIError::Field(FieldError::Empty)) + } + + let mut first_is_field_sep = false; + let mut char_count: usize = 0; + let mut last_c = FIELD_SEP; + let mut num_conscutive_field_seps = 0; + + let mut field = String::new(); + let mut fields = self.0.clone(); + + let push_field = |fs: &mut Vec, f: &mut String| { + if f.len() > 0 { + fs.push(f.clone()); + f.truncate(0); + } + }; + + for (cid, c) in value.chars().enumerate() { + char_count += 1; + + if c == FIELD_SEP { + if cid == 0 { + first_is_field_sep = true; + } + num_conscutive_field_seps += 1; + if cid > 0 && last_c == FIELD_SEP { + if fields.pop().is_none() { + return Err(CLIError::Field(FieldError::PopOnEmpty(value.to_string()))) + } + } else { + push_field(&mut fields, &mut field); + } + } else { + num_conscutive_field_seps = 0; + if cid == 1 { + if first_is_field_sep { + fields.truncate(0); + } + } + field.push(c); + } + + last_c = c; + } + + push_field(&mut fields, &mut field); + + if char_count == 1 && first_is_field_sep { + fields.truncate(0); + } + if char_count > 1 && num_conscutive_field_seps == 1 { + return Err(CLIError::Field(FieldError::TrailingFieldSep(value.to_string()))) + } + + self.0 = fields; + Ok(()) + } + + pub fn did_you_mean(value: &str, possible_values: &[&str]) -> Option { + if value.len() == 0 { + return None + } + + let mut last_c = FIELD_SEP; + + let mut field = String::new(); + let mut output = String::new(); + + let push_field = |fs: &mut String, f: &mut String| { + if f.len() > 0 { + fs.push_str( + match did_you_mean(&f, possible_values) { + Some(candidate) => candidate, + None => &f, + }); + f.truncate(0); + } + }; + + for (cid, c) in value.chars().enumerate() { + if c == FIELD_SEP { + if last_c != FIELD_SEP { + push_field(&mut output, &mut field); + } + output.push(c); + } else { + field.push(c); + } + + last_c = c; + } + + push_field(&mut output, &mut field); + + if &output == value { + None + } else { + Some(output) + } + } + + pub fn set_json_value(&self, mut object: &mut Value, + value: &str, type_info: JsonTypeInfo, + err: &mut InvalidOptionsError, + orig_cursor: &FieldCursor) { + assert!(self.0.len() > 0); + + for field in &self.0[..self.0.len()-1] { + let tmp = object; + object = + match *tmp { + Value::Object(ref mut mapping) => { + mapping.entry(field.to_owned()).or_insert( + Value::Object(Default::default()) + ) + }, + _ => panic!("We don't expect non-object Values here ...") + }; + } + + match *object { + Value::Object(ref mut mapping) => { + let field = &self.0[self.0.len()-1]; + let to_jval = + |value: &str, jtype: JsonType, err: &mut InvalidOptionsError| + -> Value { + match jtype { + JsonType::Boolean => + Value::Bool(arg_from_str(value, err, &field, "boolean")), + JsonType::Int => + Value::I64(arg_from_str(value, err, &field, "int")), + JsonType::Uint => + Value::U64(arg_from_str(value, err, &field, "uint")), + JsonType::Float => + Value::F64(arg_from_str(value, err, &field, "float")), + JsonType::String => + Value::String(value.to_owned()), + } + }; + + match type_info.ctype { + ComplexType::Pod => { + if mapping.insert(field.to_owned(), to_jval(value, type_info.jtype, err)).is_some() { + err.issues.push(CLIError::Field(FieldError::Duplicate(orig_cursor.to_string()))); + } + }, + ComplexType::Vec => { + match *mapping.entry(field.to_owned()) + .or_insert(Value::Array(Default::default())) { + Value::Array(ref mut values) => values.push(to_jval(value, type_info.jtype, err)), + _ => unreachable!() + } + }, + ComplexType::Map => { + let (key, value) = parse_kv_arg(value, err, true); + let jval = to_jval(value.unwrap_or(""), type_info.jtype, err); + + match *mapping.entry(field.to_owned()) + .or_insert(Value::Object(Default::default())) { + Value::Object(ref mut value_map) => { + if value_map.insert(key.to_owned(), jval).is_some() { + err.issues.push(CLIError::Field(FieldError::Duplicate(orig_cursor.to_string()))); + } + } + _ => unreachable!() + } + } + } + }, + _ => unreachable!() + } + } + + pub fn num_fields(&self) -> usize { + self.0.len() + } +} + +pub fn parse_kv_arg<'a>(kv: &'a str, err: &mut InvalidOptionsError, for_hashmap: bool) + -> (&'a str, Option<&'a str>) { + let mut add_err = || err.issues.push(CLIError::InvalidKeyValueSyntax(kv.to_string(),for_hashmap)); + match kv.find('=') { + None => { + add_err(); + return (kv, None) + }, + Some(pos) => { + let key = &kv[..pos]; + if kv.len() <= pos + 1 { + add_err(); + return (key, Some("")) + } + (key, Some(&kv[pos+1..])) + } + } +} + +pub fn calltype_from_str(name: &str, valid_protocols: Vec, err: &mut InvalidOptionsError) -> CallType { + CallType::Upload( + match UploadProtocol::from_str(name) { + Ok(up) => up, + Err(msg) => { + err.issues.push(CLIError::InvalidUploadProtocol(name.to_string(), valid_protocols)); + UploadProtocol::Simple + } + }) +} + +pub fn input_file_from_opts(file_path: &str, err: &mut InvalidOptionsError) -> Option { + match fs::File::open(file_path) { + Ok(f) => Some(f), + Err(io_err) => { + err.issues.push(CLIError::Input(InputError::IOError((file_path.to_string(), io_err)))); + None + } + } +} + +pub fn input_mime_from_opts(mime: &str, err: &mut InvalidOptionsError) -> Option { + match mime.parse() { + Ok(m) => Some(m), + Err(_) => { + err.issues.push(CLIError::Input(InputError::Mime(mime.to_string()))); + None + } + } +} + +pub fn writer_from_opts(arg: Option<&str>) -> Result, io::Error> { + let f = arg.unwrap_or("-"); + match f { + "-" => Ok(Box::new(stdout())), + _ => match fs::OpenOptions::new().create(true).write(true).open(f) { + Ok(f) => Ok(Box::new(f)), + Err(io_err) => Err(io_err), + } + } +} + + +pub fn arg_from_str<'a, T>(arg: &str, err: &mut InvalidOptionsError, + arg_name: &'a str, + arg_type: &'a str) -> T + where T: FromStr + Default, + ::Err: fmt::Display { + match FromStr::from_str(arg) { + Err(perr) => { + err.issues.push( + CLIError::ParseError(arg_name.to_owned(), arg_type.to_owned(), arg.to_string(), format!("{}", perr)) + ); + Default::default() + }, + Ok(v) => v, + } +} + +pub struct JsonTokenStorage { + pub program_name: &'static str, + pub db_dir: String, +} + +impl JsonTokenStorage { + fn path(&self, scope_hash: u64) -> PathBuf { + Path::new(&self.db_dir).join(&format!("{}-token-{}.json", self.program_name, scope_hash)) + } +} + +impl TokenStorage for JsonTokenStorage { + type Error = json::Error; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, scope_hash: u64, _: &Vec<&str>, token: Option) -> Result<(), json::Error> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => + match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(json::Error::IoError(err)) + }, + Ok(_) => Ok(()), + } + } + Some(token) => { + match fs::OpenOptions::new().create(true).write(true).open(&self.path(scope_hash)) { + Ok(mut f) => { + match json::to_writer_pretty(&mut f, &token) { + Ok(_) => Ok(()), + Err(io_err) => Err(json::Error::IoError(io_err)), + } + }, + Err(io_err) => Err(json::Error::IoError(io_err)) + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, json::Error> { + match fs::File::open(&self.path(scope_hash)) { + Ok(mut f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(err), + } + }, + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(json::Error::IoError(io_err)) + } + } + } + } +} + + +#[derive(Debug)] +pub enum ApplicationSecretError { + DecoderError((String, json::Error)), + FormatError(String), +} + +impl fmt::Display for ApplicationSecretError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + ApplicationSecretError::DecoderError((ref path, ref err)) + => writeln!(f, "Could not decode file at '{}' with error: {}.", + path, err), + ApplicationSecretError::FormatError(ref path) + => writeln!(f, "'installed' field is unset in secret file at '{}'.", + path), + } + } +} + +#[derive(Debug)] +pub enum ConfigurationError { + DirectoryCreationFailed((String, io::Error)), + DirectoryUnset, + HomeExpansionFailed(String), + Secret(ApplicationSecretError), + IOError((String, io::Error)), +} + +impl fmt::Display for ConfigurationError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + ConfigurationError::DirectoryCreationFailed((ref dir, ref err)) + => writeln!(f, "Directory '{}' could not be created with error: {}.", dir, err), + ConfigurationError::DirectoryUnset + => writeln!(f, "--config-dir was unset or empty."), + ConfigurationError::HomeExpansionFailed(ref dir) + => writeln!(f, "Couldn't find HOME directory of current user, failed to expand '{}'.", dir), + ConfigurationError::Secret(ref err) + => writeln!(f, "Secret -> {}", err), + ConfigurationError::IOError((ref path, ref err)) + => writeln!(f, "IO operation failed on path '{}' with error: {}.", path, err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + IOError((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::IOError((ref file_path, ref io_err)) + => writeln!(f, "Failed to open '{}' for reading with error: {}.", file_path, io_err), + InputError::Mime(ref mime) + => writeln!(f, "'{}' is not a known mime-type.", mime), + } + } +} + +#[derive(Debug)] +pub enum FieldError { + PopOnEmpty(String), + TrailingFieldSep(String), + Unknown(String, Option, Option), + Duplicate(String), + Empty, +} + + +impl fmt::Display for FieldError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + FieldError::PopOnEmpty(ref field) + => writeln!(f, "'{}': Cannot move up on empty field cursor.", field), + FieldError::TrailingFieldSep(ref field) + => writeln!(f, "'{}': Single field separator may not be last character.", field), + FieldError::Unknown(ref field, ref suggestion, ref value) => { + let suffix = + match *suggestion { + Some(ref s) => { + let kv = + match *value { + Some(ref v) => format!("{}={}", s, v), + None => s.clone(), + }; + format!(" Did you mean '{}' ?", kv) + }, + None => String::new(), + }; + writeln!(f, "Field '{}' does not exist.{}", field, suffix) + }, + FieldError::Duplicate(ref cursor) + => writeln!(f, "Value at '{}' was already set", cursor), + FieldError::Empty + => writeln!(f, "Field names must not be empty."), + } + } +} + + +#[derive(Debug)] +pub enum CLIError { + Configuration(ConfigurationError), + ParseError(String, String, String, String), + UnknownParameter(String, Vec<&'static str>), + InvalidUploadProtocol(String, Vec), + InvalidKeyValueSyntax(String, bool), + Input(InputError), + Field(FieldError), + MissingCommandError, + MissingMethodError(String), +} + +impl fmt::Display for CLIError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + CLIError::Configuration(ref err) => write!(f, "Configuration -> {}", err), + CLIError::Input(ref err) => write!(f, "Input -> {}", err), + CLIError::Field(ref err) => write!(f, "Field -> {}", err), + CLIError::InvalidUploadProtocol(ref proto_name, ref valid_names) + => writeln!(f, "'{}' is not a valid upload protocol. Choose from one of {}.", proto_name, valid_names.connect(", ")), + CLIError::ParseError(ref arg_name, ref type_name, ref value, ref err_desc) + => writeln!(f, "Failed to parse argument '{}' with value '{}' as {} with error: {}.", + arg_name, value, type_name, err_desc), + CLIError::UnknownParameter(ref param_name, ref possible_values) => { + let mut suffix = + match did_you_mean(param_name, &possible_values) { + Some(v) => format!(" Did you mean '{}' ?", v), + None => String::new(), + }; + write!(f, "Parameter '{}' is unknown.{}\n", param_name, suffix) + }, + CLIError::InvalidKeyValueSyntax(ref kv, is_hashmap) => { + let hashmap_info = if is_hashmap { "hashmap " } else { "" }; + writeln!(f, "'{}' does not match {}pattern =.", kv, hashmap_info) + }, + CLIError::MissingCommandError => writeln!(f, "Please specify the main sub-command."), + CLIError::MissingMethodError(ref cmd) => writeln!(f, "Please specify the method to call on the '{}' command.", cmd), + } + } +} + +#[derive(Debug)] +pub struct InvalidOptionsError { + pub issues: Vec, + pub exit_code: i32, +} + +impl fmt::Display for InvalidOptionsError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + for issue in &self.issues { + try!(issue.fmt(f)); + } + Ok(()) + } +} + +impl InvalidOptionsError { + pub fn single(err: CLIError, exit_code: i32) -> InvalidOptionsError { + InvalidOptionsError { + issues: vec![err], + exit_code: exit_code, + } + } + + pub fn new() -> InvalidOptionsError { + InvalidOptionsError { + issues: Vec::new(), + exit_code: 1, + } + } +} + +pub fn assure_config_dir_exists(dir: &str) -> Result { + let trdir = dir.trim(); + if trdir.len() == 0 { + return Err(CLIError::Configuration(ConfigurationError::DirectoryUnset)) + } + + let expanded_config_dir = + if trdir.as_bytes()[0] == b'~' { + match env::var("HOME").ok().or(env::var("UserProfile").ok()) { + None => return Err(CLIError::Configuration(ConfigurationError::HomeExpansionFailed(trdir.to_string()))), + Some(mut user) => { + user.push_str(&trdir[1..]); + user + } + } + } else { + trdir.to_string() + }; + + if let Err(err) = fs::create_dir(&expanded_config_dir) { + if err.kind() != io::ErrorKind::AlreadyExists { + return Err(CLIError::Configuration( + ConfigurationError::DirectoryCreationFailed((expanded_config_dir, err)))) + } + } + + Ok(expanded_config_dir) +} + +pub fn application_secret_from_directory(dir: &str, + secret_basename: &str, + json_console_secret: &str) + -> Result { + let secret_path = Path::new(dir).join(secret_basename); + let secret_str = || secret_path.as_path().to_str().unwrap().to_string(); + let secret_io_error = |io_err: io::Error| { + Err(CLIError::Configuration(ConfigurationError::IOError( + (secret_str(), io_err) + ))) + }; + + for _ in 0..2 { + match fs::File::open(&secret_path) { + Err(mut err) => { + if err.kind() == io::ErrorKind::NotFound { + // Write our built-in one - user may adjust the written file at will + + err = match fs::OpenOptions::new().create(true).write(true).open(&secret_path) { + Err(cfe) => cfe, + Ok(mut f) => { + // Assure we convert 'ugly' json string into pretty one + let console_secret: ConsoleApplicationSecret + = json::from_str(json_console_secret).unwrap(); + match json::to_writer_pretty(&mut f, &console_secret) { + Err(io_err) => io_err, + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err) + }, + Ok(mut f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + Err(json::Error::IoError(err)) => + return secret_io_error(err), + Err(json_err) => + return Err(CLIError::Configuration( + ConfigurationError::Secret( + ApplicationSecretError::DecoderError( + (secret_str(), json_err) + )))), + Ok(console_secret) => + match console_secret.installed { + Some(secret) => return Ok(secret), + None => return Err( + CLIError::Configuration( + ConfigurationError::Secret( + ApplicationSecretError::FormatError(secret_str()) + ))) + }, + } + } + } + } + unreachable!(); +} \ No newline at end of file diff --git a/gen/cloudresourcemanager1_beta1-cli/src/main.rs b/gen/cloudresourcemanager1_beta1-cli/src/main.rs new file mode 100644 index 0000000000..a0b2229d19 --- /dev/null +++ b/gen/cloudresourcemanager1_beta1-cli/src/main.rs @@ -0,0 +1,794 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/cli/main.rs.mako' +// DO NOT EDIT ! +#![allow(unused_variables, unused_imports, dead_code, unused_mut)] + +#[macro_use] +extern crate clap; +extern crate yup_oauth2 as oauth2; +extern crate yup_hyper_mock as mock; +extern crate serde; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_cloudresourcemanager1_beta1 as api; + +use std::env; +use std::io::{self, Write}; +use clap::{App, SubCommand, Arg}; + +mod cmn; + +use cmn::{InvalidOptionsError, CLIError, JsonTokenStorage, arg_from_str, writer_from_opts, parse_kv_arg, + input_file_from_opts, input_mime_from_opts, FieldCursor, FieldError, CallType, UploadProtocol, + calltype_from_str, remove_json_null_values, ComplexType, JsonType, JsonTypeInfo}; + +use std::default::Default; +use std::str::FromStr; + +use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; +use serde::json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n, 'a> { + opt: ArgMatches<'n, 'a>, + hub: api::Cloudresourcemanager>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n, 'a> Engine<'n, 'a> { + fn _projects_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()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "project-number" => Some(("projectNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "labels", "lifecycle-state", "name", "project-id", "project-number"]); + 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::Project = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().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 _projects_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().delete(opt.value_of("project-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 _projects_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().get(opt.value_of("project-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 _projects_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().list(); + 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 _projects_undelete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().undelete(opt.value_of("project-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 _projects_update(&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()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "project-number" => Some(("projectNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "labels", "lifecycle-state", "name", "project-id", "project-number"]); + 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::Project = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().update(request, opt.value_of("project-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 _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() { + ("projects", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._projects_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._projects_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._projects_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._projects_list(opt, dry_run, &mut err); + }, + ("undelete", Some(opt)) => { + call_result = self._projects_undelete(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._projects_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("projects".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + _ => { + err.issues.push(CLIError::MissingCommandError); + writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); + } + } + + if dry_run { + if err.issues.len() > 0 { + err_opt = Some(err); + } + Err(err_opt) + } else { + Ok(call_result) + } + } + + // Please note that this call will fail if any part of the opt can't be handled + fn new(opt: ArgMatches<'a, 'n>) -> Result, InvalidOptionsError> { + let (config_dir, secret) = { + let config_dir = match cmn::assure_config_dir_exists(opt.value_of("folder").unwrap_or("~/.google-service-cli")) { + Err(e) => return Err(InvalidOptionsError::single(e, 3)), + Ok(p) => p, + }; + + match cmn::application_secret_from_directory(&config_dir, "cloudresourcemanager1-beta1-secret.json", + "{\"installed\":{\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_secret\":\"hCsslbCUyfehWMmbkG8vTYxG\",\"token_uri\":\"https://accounts.google.com/o/oauth2/token\",\"client_email\":\"\",\"redirect_uris\":[\"urn:ietf:wg:oauth:2.0:oob\",\"oob\"],\"client_x509_cert_url\":\"\",\"client_id\":\"620010449518-9ngf7o4dhs0dka470npqvor6dc5lqb9b.apps.googleusercontent.com\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\"}}") { + Ok(secret) => (config_dir, secret), + Err(e) => return Err(InvalidOptionsError::single(e, 4)) + } + }; + + let auth = Authenticator::new( &secret, DefaultAuthenticatorDelegate, + if opt.is_present("debug-auth") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::::default() + }) + } else { + hyper::Client::new() + }, + JsonTokenStorage { + program_name: "cloudresourcemanager1-beta1", + db_dir: config_dir.clone(), + }, None); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::::default() + }) + } else { + hyper::Client::new() + }; + let engine = Engine { + opt: opt, + hub: api::Cloudresourcemanager::new(client, auth), + gp: vec!["$-xgafv", "access-token", "alt", "bearer-token", "callback", "fields", "key", "oauth-token", "pp", "pretty-print", "quota-user", "upload-type", "upload-protocol"], + gpm: vec![ + ("$-xgafv", "$.xgafv"), + ("access-token", "access_token"), + ("bearer-token", "bearer_token"), + ("oauth-token", "oauth_token"), + ("pretty-print", "prettyPrint"), + ("quota-user", "quotaUser"), + ("upload-type", "uploadType"), + ("upload-protocol", "upload_protocol"), + ] + }; + + match engine._doit(true) { + Err(Some(err)) => Err(err), + Err(None) => Ok(engine), + Ok(_) => unreachable!(), + } + } + + fn doit(&self) -> Result<(), DoitError> { + match self._doit(false) { + Ok(res) => res, + Err(_) => unreachable!(), + } + } +} + +fn main() { + let mut exit_status = 0i32; + let arg_data = [ + ("projects", "methods: 'create', 'delete', 'get', 'list', 'undelete' and 'update'", vec![ + ("create", + Some(r##"Creates a project resource. Initially, the project resource is owned by its creator exclusively. The creator can later grant permission to others to read or update the project. Several APIs are activated automatically for the project, including Google Cloud Storage."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1_cli/projects_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##"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."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1_cli/projects_delete", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The project ID (for example, `foo-bar-123`). Required."##), + 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##"Retrieves the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this project."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1_cli/projects_get", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The project ID (for example, `my-project-123`). Required."##), + 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 projects that are visible to the user and satisfy the specified filter. This method returns projects in an unspecified order. New projects do not necessarily appear at the end of the list."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1_cli/projects_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)), + ]), + ("undelete", + Some(r##"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."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1_cli/projects_undelete", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The project ID (for example, `foo-bar-123`). Required."##), + 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)), + ]), + ("update", + Some(r##"Updates the attributes of the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have modify permissions for this project."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1_cli/projects_update", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The project ID (for example, `my-project-123`). Required."##), + 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)), + ]), + ]), + + ]; + + let mut app = App::new("cloudresourcemanager1-beta1") + .author("Sebastian Thiel ") + .version("0.3.0+20150603") + .about("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.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1_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") + .multiple(false) + .takes_value(true)) + .arg(Arg::with_name("debug") + .long("debug") + .help("Output all server communication to standard error. `tx` and `rx` are placed into the same stream.") + .multiple(false) + .takes_value(false)) + .arg(Arg::with_name("debug-auth") + .long("debug-auth") + .help("Output all communication related to authentication to standard error. `tx` and `rx` are placed into the same stream.") + .multiple(false) + .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); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::new(sub_command_name); + if let &Some(desc) = desc { + scmd = scmd.about(desc); + } + scmd = scmd.after_help(url_info); + + for &(ref arg_name, ref flag, ref desc, ref required, ref multi) in args { + let arg_name_str = + match (arg_name, flag) { + (&Some(an), _ ) => an, + (_ , &Some(f)) => f, + _ => unreachable!(), + }; + let mut arg = Arg::with_name(arg_name_str) + .empty_values(false); + if let &Some(short_flag) = flag { + arg = arg.short(short_flag); + } + if let &Some(desc) = desc { + arg = arg.help(desc); + } + if arg_name.is_some() && flag.is_some() { + arg = arg.takes_value(true); + } + if let &Some(required) = required { + arg = arg.required(required); + } + if let &Some(multi) = multi { + arg = arg.multiple(multi); + } + scmd = scmd.arg(arg); + } + mcmd = mcmd.subcommand(scmd); + } + app = app.subcommand(mcmd); + } + + let matches = app.get_matches(); + + let debug = matches.is_present("debug"); + match Engine::new(matches) { + Err(err) => { + exit_status = err.exit_code; + writeln!(io::stderr(), "{}", err).ok(); + }, + Ok(engine) => { + if let Err(doit_err) = engine.doit() { + exit_status = 1; + match doit_err { + DoitError::IoError(path, err) => { + writeln!(io::stderr(), "Failed to open output file '{}': {}", path, err).ok(); + }, + DoitError::ApiError(err) => { + if debug { + writeln!(io::stderr(), "{:?}", err).ok(); + } else { + writeln!(io::stderr(), "{}", err).ok(); + } + } + } + } + } + } + + std::process::exit(exit_status); +} \ No newline at end of file diff --git a/gen/cloudresourcemanager1_beta1/Cargo.toml b/gen/cloudresourcemanager1_beta1/Cargo.toml new file mode 100644 index 0000000000..20b1cd4166 --- /dev/null +++ b/gen/cloudresourcemanager1_beta1/Cargo.toml @@ -0,0 +1,28 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-cloudresourcemanager1_beta1" +version = "0.1.8+20150603" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with cloudresourcemanager (protocol v1beta1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1_beta1" +homepage = "https://cloud.google.com/resource-manager" +documentation = "http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1" +license = "MIT" +keywords = ["cloudresourcemanager", "google", "protocol", "web", "api"] +build = "src/build.rs" + + +[dependencies] +hyper = ">= 0.6.0" +mime = "0.0.12" +serde = ">= 0.4.1" +yup-oauth2 = "*" +url = "*" + +[build-dependencies] +syntex = { version = "*" } +serde_codegen = { version = "*" } + diff --git a/gen/cloudresourcemanager1_beta1/LICENSE.md b/gen/cloudresourcemanager1_beta1/LICENSE.md new file mode 100644 index 0000000000..ae22e6ec52 --- /dev/null +++ b/gen/cloudresourcemanager1_beta1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015` `Sebastian Thiel` + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the “Software”), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/gen/cloudresourcemanager1_beta1/README.md b/gen/cloudresourcemanager1_beta1/README.md new file mode 100644 index 0000000000..dd2248265d --- /dev/null +++ b/gen/cloudresourcemanager1_beta1/README.md @@ -0,0 +1,181 @@ + +The `google-cloudresourcemanager1_beta1` library allows access to all features of the *Google cloudresourcemanager* service. + +This documentation was generated from *cloudresourcemanager* crate version *0.1.8+20150603*, where *20150603* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. + +Everything else about the *cloudresourcemanager* *v1_beta1* API can be found at the +[official documentation site](https://cloud.google.com/resource-manager). +# Features + +Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/struct.Cloudresourcemanager.html) ... + +* [projects](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/struct.Project.html) + * [*create*](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/struct.ProjectCreateCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/struct.ProjectDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/struct.ProjectGetCall.html), [*list*](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/struct.ProjectListCall.html), [*undelete*](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/struct.ProjectUndeleteCall.html) and [*update*](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/struct.ProjectUpdateCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/struct.Cloudresourcemanager.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.CallBuilder.html) +* **[Resources](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.CallBuilder.html)** + * operations to apply to *Resources* + +All *structures* are marked with applicable traits to further categorize them and ease browsing. + +Generally speaking, you can invoke *Activities* like this: + +```Rust,ignore +let r = hub.resource().activity(...).doit() +``` + +Or specifically ... + +```ignore +let r = hub.projects().delete(...).doit() +let r = hub.projects().undelete(...).doit() +let r = hub.projects().get(...).doit() +let r = hub.projects().update(...).doit() +let r = hub.projects().create(...).doit() +let r = hub.projects().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 +specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired. +The `doit()` method performs the actual communication with the server and returns the respective result. + +# Usage + +## Setting up your Project + +To use this library, you would put the following lines into your `Cargo.toml` file: + +```toml +[dependencies] +google-cloudresourcemanager1_beta1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate yup_oauth2 as oauth2; +extern crate google_cloudresourcemanager1_beta1 as cloudresourcemanager1_beta1; +use cloudresourcemanager1_beta1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use cloudresourcemanager1_beta1::Cloudresourcemanager; + +// Get an ApplicationSecret instance by some means. It contains the `client_id` and +// `client_secret`, among other things. +let secret: ApplicationSecret = Default::default(); +// Instantiate the authenticator. It will choose a suitable authentication flow for you, +// unless you replace `None` with the desired Flow. +// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +// what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +// retrieve them from storage. +let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, + hyper::Client::new(), + ::default(), None); +let mut hub = Cloudresourcemanager::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.projects().list() + .page_token("eirmod") + .page_size(-48) + .filter("Stet") + .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_cloudresourcemanager1_beta1/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.Delegate.html), or the [Authenticator Delegate](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/../yup-oauth2/trait.AuthenticatorDelegate.html). + +When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This +makes the system potentially resilient to all kinds of errors. + +## Uploads and Downloads +If a method supports downloads, the response body, which is part of the [Result](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.ResponseResult.html), it will return that by default. +You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making +this call: `.param("alt", "media")`. + +Methods supporting uploads can do so using up to 2 different protocols: +*simple* and *resumable*. The distinctiveness of each is represented by customized +`doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively. + +## Customization and Callbacks + +You may alter the way an `doit()` method is called by providing a [delegate](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.Delegate.html) to the +[Method Builder](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +Respective methods will be called to provide progress information, as well as determine whether the system should +retry on failure. + +The [delegate trait](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. + +## Optional Parts in Server-Requests + +All structures provided by this library are made to be [enocodable](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.RequestValue.html) and +[decodable](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +the server to indicate either the set parts of the request or the desired parts in the response. + +## Builder Arguments + +Using [method builders](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +These will always take a single argument, for which the following statements are true. + +* [PODs][wiki-pod] are handed by copy +* strings are passed as `&str` +* [request values](http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1/trait.RequestValue.html) are moved + +Arguments will always be copied or cloned into the builder, to make them independent of their original life times. + +[wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure +[builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern +[google-go-api]: https://github.com/google/google-api-go-client + +# License +The **cloudresourcemanager1_beta1** library was generated by Sebastian Thiel, and is placed +under the *MIT* license. +You can read the full text at the repository's [license file][repo-license]. + +[repo-license]: https://github.com/Byron/google-apis-rs/LICENSE.md diff --git a/gen/cloudresourcemanager1_beta1/src/build.rs b/gen/cloudresourcemanager1_beta1/src/build.rs new file mode 100644 index 0000000000..be55a3b141 --- /dev/null +++ b/gen/cloudresourcemanager1_beta1/src/build.rs @@ -0,0 +1,16 @@ +extern crate syntex; +extern crate serde_codegen; + +use std::env; +use std::path::Path; + +pub fn main() { + let out_dir = env::var_os("OUT_DIR").unwrap(); + + let src = Path::new("src/lib.rs.in"); + let dst = Path::new(&out_dir).join("lib.rs"); + + let mut registry = syntex::Registry::new(); + serde_codegen::register(&mut registry); + registry.expand("google-cloudresourcemanager1_beta1", &src, &dst).unwrap(); +} diff --git a/gen/cloudresourcemanager1_beta1/src/cmn.rs b/gen/cloudresourcemanager1_beta1/src/cmn.rs new file mode 100644 index 0000000000..defecc802c --- /dev/null +++ b/gen/cloudresourcemanager1_beta1/src/cmn.rs @@ -0,0 +1,762 @@ +// COPY OF 'src/rust/api/cmn.rs' +// DO NOT EDIT +use std::io::{self, Read, Seek, Cursor, Write, SeekFrom}; +use std; +use std::fmt::{self, Display}; +use std::str::FromStr; +use std::error; +use std::thread::sleep_ms; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde; + +/// Identifies the Hub. There is only one per library, this trait is supposed +/// to make intended use more explicit. +/// The hub allows to access all resource methods more easily. +pub trait Hub {} + +/// Identifies types for building methods of a particular resource type +pub trait MethodsBuilder {} + +/// Identifies types which represent builders for a particular resource method +pub trait CallBuilder {} + +/// Identifies types which can be inserted and deleted. +/// Types with this trait are most commonly used by clients of this API. +pub trait Resource {} + +/// Identifies types which are used in API responses. +pub trait ResponseResult {} + +/// Identifies types which are used in API requests. +pub trait RequestValue {} + +/// Identifies types which are not actually used by the API +/// This might be a bug within the google API schema. +pub trait UnusedType {} + +/// Identifies types which are only used as part of other types, which +/// usually are carrying the `Resource` trait. +pub trait Part {} + +/// Identifies types which are only used by other types internally. +/// They have no special meaning, this trait just marks them for completeness. +pub trait NestedType {} + +/// A utility to specify reader types which provide seeking capabilities too +pub trait ReadSeek: Seek + Read {} +impl ReadSeek for T {} + +/// A trait for all types that can convert themselves into a *parts* string +pub trait ToParts { + fn to_parts(&self) -> String; +} + +/// A utility type which can decode a server response that indicates error +#[derive(Deserialize)] +pub struct JsonServerError { + pub error: String, + pub error_description: Option +} + +/// A utility to represent detailed errors we might see in case there are BadRequests. +/// The latter happen if the sent parameters or request structures are unsound +#[derive(Deserialize, Serialize, Debug)] +pub struct ErrorResponse { + error: ServerError, +} + +#[derive(Deserialize, Serialize, Debug)] +pub struct ServerError { + errors: Vec, + code: u16, + message: String, +} + +#[derive(Deserialize, Serialize, Debug)] +pub struct ServerMessage { + domain: String, + reason: String, + message: String, + #[serde(rename="locationType")] + location_type: Option, + location: Option +} + +#[derive(Copy, Clone)] +pub struct DummyNetworkStream; + +impl Read for DummyNetworkStream { + fn read(&mut self, _: &mut [u8]) -> io::Result { + Ok(0) + } +} + +impl Write for DummyNetworkStream { + fn write(&mut self, _: &[u8]) -> io::Result { + Ok(0) + } + + fn flush(&mut self) -> io::Result<()> { + Ok(()) + } +} + +impl hyper::net::NetworkStream for DummyNetworkStream { + fn peer_addr(&mut self) -> io::Result { + Ok("127.0.0.1:1337".parse().unwrap()) + } +} + + +/// A trait specifying functionality to help controlling any request performed by the API. +/// The trait has a conservative default implementation. +/// +/// It contains methods to deal with all common issues, as well with the ones related to +/// uploading media +pub trait Delegate { + + /// Called at the beginning of any API request. The delegate should store the method + /// information if he is interesting in knowing more context when further calls to it + /// are made. + /// The matching `finished()` call will always be made, no matter whether or not the API + /// request was successful. That way, the delegate may easily maintain a clean state + /// between various API calls. + fn begin(&mut self, MethodInfo) {} + + /// Called whenever there is an [HttpError](http://hyperium.github.io/hyper/hyper/error/enum.HttpError.html), usually if there are network problems. + /// + /// If you choose to retry after a duration, the duration should be chosen using the + /// [exponential backoff algorithm](http://en.wikipedia.org/wiki/Exponential_backoff). + /// + /// Return retry information. + fn http_error(&mut self, &hyper::Error) -> Retry { + Retry::Abort + } + + /// Called whenever there is the need for your applications API key after + /// the official authenticator implementation didn't provide one, for some reason. + /// If this method returns None as well, the underlying operation will fail + fn api_key(&mut self) -> Option { + None + } + + /// Called whenever the Authenticator didn't yield a token. The delegate + /// may attempt to provide one, or just take it as a general information about the + /// impending failure. + /// The given Error provides information about why the token couldn't be acquired in the + /// first place + fn token(&mut self, err: &error::Error) -> Option { + let _ = err; + None + } + + /// Called during resumable uploads to provide a URL for the impending upload. + /// It was saved after a previous call to `store_upload_url(...)`, and if not None, + /// will be used instead of asking the server for a new upload URL. + /// This is useful in case a previous resumable upload was aborted/canceled, but should now + /// be resumed. + /// The returned URL will be used exactly once - if it fails again and the delegate allows + /// to retry, we will ask the server for a new upload URL. + fn upload_url(&mut self) -> Option { + None + } + + /// Called after we have retrieved a new upload URL for a resumable upload to store it + /// in case we fail or cancel. That way, we can attempt to resume the upload later, + /// see `upload_url()`. + /// It will also be called with None after a successful upload, which allows the delegate + /// to forget the URL. That way, we will not attempt to resume an upload that has already + /// finished. + fn store_upload_url(&mut self, url: Option<&str>) { + let _ = url; + } + + /// Called whenever a server response could not be decoded from json. + /// It's for informational purposes only, the caller will return with an error + /// accordingly. + /// + /// # Arguments + /// + /// * `json_encoded_value` - The json-encoded value which failed to decode. + /// * `json_decode_error` - The decoder error + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + let _ = json_encoded_value; + let _ = json_decode_error; + } + + /// Called whenever the http request returns with a non-success status code. + /// This can involve authentication issues, or anything else that very much + /// depends on the used API method. + /// The delegate should check the status, header and decoded json error to decide + /// whether to retry or not. In the latter case, the underlying call will fail. + /// + /// If you choose to retry after a duration, the duration should be chosen using the + /// [exponential backoff algorithm](http://en.wikipedia.org/wiki/Exponential_backoff). + fn http_failure(&mut self, _: &hyper::client::Response, Option, _: Option) -> Retry { + Retry::Abort + } + + /// Called prior to sending the main request of the given method. It can be used to time + /// the call or to print progress information. + /// It's also useful as you can be sure that a request will definitely be made. + fn pre_request(&mut self) { } + + /// Return the size of each chunk of a resumable upload. + /// Must be a power of two, with 1<<18 being the smallest allowed chunk size. + /// Will be called once before starting any resumable upload. + fn chunk_size(&mut self) -> u64 { + 1 << 23 + } + + /// Called before the given chunk is uploaded to the server. + /// If true is returned, the upload will be interrupted. + /// However, it may be resumable if you stored the upload URL in a previous call + /// to `store_upload_url()` + fn cancel_chunk_upload(&mut self, chunk: &ContentRange) -> bool { + let _ = chunk; + false + } + + /// Called before the API request method returns, in every case. It can be used to clean up + /// internal state between calls to the API. + /// This call always has a matching call to `begin(...)`. + /// + /// # Arguments + /// + /// * `is_success` - a true value indicates the operation was successful. If false, you should + /// discard all values stored during `store_upload_url`. + fn finished(&mut self, is_success: bool) { + let _ = is_success; + } +} + +/// A delegate with a conservative default implementation, which is used if no other delegate is +/// set. +#[derive(Default)] +pub struct DefaultDelegate; + +impl Delegate for DefaultDelegate {} + + +#[derive(Debug)] +pub enum Error { + /// The http connection failed + HttpError(hyper::Error), + + /// An attempt was made to upload a resource with size stored in field `.0` + /// even though the maximum upload size is what is stored in field `.1`. + UploadSizeLimitExceeded(u64, u64), + + /// Represents information about a request that was not understood by the server. + /// Details are included. + BadRequest(ErrorResponse), + + /// We needed an API key for authentication, but didn't obtain one. + /// Neither through the authenticator, nor through the Delegate. + MissingAPIKey, + + /// We required a Token, but didn't get one from the Authenticator + MissingToken(Box), + + /// The delgate instructed to cancel the operation + Cancelled, + + /// An additional, free form field clashed with one of the built-in optional ones + FieldClash(&'static str), + + /// Shows that we failed to decode the server response. + /// This can happen if the protocol changes in conjunction with strict json decoding. + JsonDecodeError(String, serde::json::Error), + + /// Indicates an HTTP repsonse with a non-success status code + Failure(hyper::client::Response), +} + + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + Error::HttpError(ref err) => err.fmt(f), + Error::UploadSizeLimitExceeded(ref resource_size, ref max_size) => + writeln!(f, "The media size {} exceeds the maximum allowed upload size of {}" + , resource_size, max_size), + Error::MissingAPIKey => { + (writeln!(f, "The application's API key was not found in the configuration")).ok(); + writeln!(f, "It is used as there are no Scopes defined for this method.") + }, + Error::BadRequest(ref err) => { + try!(writeln!(f, "Bad Requst ({}): {}", err.error.code, err.error.message)); + for err in err.error.errors.iter() { + try!(writeln!(f, " {}: {}, {}{}", + err.domain, + err.message, + err.reason, + match &err.location { + &Some(ref loc) => format!("@{}", loc), + &None => String::new(), + })); + } + Ok(()) + }, + Error::MissingToken(ref err) => + writeln!(f, "Token retrieval failed with error: {}", err), + Error::Cancelled => + writeln!(f, "Operation cancelled by delegate"), + Error::FieldClash(field) => + writeln!(f, "The custom parameter '{}' is already provided natively by the CallBuilder.", field), + Error::JsonDecodeError(ref json_str, ref err) + => writeln!(f, "{}: {}", err, json_str), + Error::Failure(ref response) => + writeln!(f, "Http status indicates failure: {:?}", response), + } + } +} + +impl error::Error for Error { + fn description(&self) -> &str { + match *self { + Error::HttpError(ref err) => err.description(), + Error::JsonDecodeError(_, ref err) => err.description(), + _ => "NO DESCRIPTION POSSIBLE - use `Display.fmt()` instead" + } + } + + fn cause(&self) -> Option<&error::Error> { + match *self { + Error::HttpError(ref err) => err.cause(), + Error::JsonDecodeError(_, ref err) => err.cause(), + _ => None + } + } +} + +/// A universal result type used as return for all calls. +pub type Result = std::result::Result; + +/// Contains information about an API request. +pub struct MethodInfo { + pub id: &'static str, + pub http_method: Method, +} + +const BOUNDARY: &'static str = "MDuXWGyeE33QFXGchb2VFWc4Z7945d"; + +/// Provides a `Read` interface that converts multiple parts into the protocol +/// identified by [RFC2387](https://tools.ietf.org/html/rfc2387). +/// **Note**: This implementation is just as rich as it needs to be to perform uploads +/// to google APIs, and might not be a fully-featured implementation. +#[derive(Default)] +pub struct MultiPartReader<'a> { + raw_parts: Vec<(Headers, &'a mut Read)>, + current_part: Option<(Cursor>, &'a mut Read)>, + last_part_boundary: Option>>, +} + +impl<'a> MultiPartReader<'a> { + + /// Reserve memory for exactly the given amount of parts + pub fn reserve_exact(&mut self, cap: usize) { + self.raw_parts.reserve_exact(cap); + } + + /// Add a new part to the queue of parts to be read on the first `read` call. + /// + /// # Arguments + /// + /// `headers` - identifying the body of the part. It's similar to the header + /// in an ordinary single-part call, and should thus contain the + /// same information. + /// `reader` - a reader providing the part's body + /// `size` - the amount of bytes provided by the reader. It will be put onto the header as + /// content-size. + /// `mime` - It will be put onto the content type + pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { + let mut headers = Headers::new(); + headers.set(ContentType(mime_type)); + headers.set(ContentLength(size)); + self.raw_parts.push((headers, reader)); + self + } + + /// Returns the mime-type representing our multi-part message. + /// Use it with the ContentType header. + pub fn mime_type(&self) -> Mime { + Mime( + TopLevel::Multipart, + SubLevel::Ext("Related".to_string()), + vec![(Attr::Ext("boundary".to_string()), Value::Ext(BOUNDARY.to_string()))], + ) + } + + /// Returns true if we are totally used + fn is_depleted(&self) -> bool { + self.raw_parts.len() == 0 && self.current_part.is_none() && self.last_part_boundary.is_none() + } + + /// Returns true if we are handling our last part + fn is_last_part(&self) -> bool { + self.raw_parts.len() == 0 && self.current_part.is_some() + } +} + +impl<'a> Read for MultiPartReader<'a> { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + match (self.raw_parts.len(), + self.current_part.is_none(), + self.last_part_boundary.is_none()) { + (_, _, false) => { + let br = self.last_part_boundary.as_mut().unwrap().read(buf).unwrap_or(0); + if br < buf.len() { + self.last_part_boundary = None; + } + return Ok(br) + }, + (0, true, true) => return Ok(0), + (n, true, _) if n > 0 => { + let (headers, reader) = self.raw_parts.remove(0); + let mut c = Cursor::new(Vec::::new()); + (write!(&mut c, "{}--{}{}{}{}", LINE_ENDING, BOUNDARY, LINE_ENDING, + headers, LINE_ENDING)).unwrap(); + c.seek(SeekFrom::Start(0)).unwrap(); + self.current_part = Some((c, reader)); + } + _ => {}, + } + + // read headers as long as possible + let (hb, rr) = { + let &mut (ref mut c, ref mut reader) = self.current_part.as_mut().unwrap(); + let b = c.read(buf).unwrap_or(0); + (b, reader.read(&mut buf[b..])) + }; + + match rr { + Ok(bytes_read) => { + if hb < buf.len() && bytes_read == 0 { + if self.is_last_part() { + // before clearing the last part, we will add the boundary that + // will be written last + self.last_part_boundary = Some(Cursor::new( + format!("{}--{}--", LINE_ENDING, BOUNDARY).into_bytes())) + } + // We are depleted - this can trigger the next part to come in + self.current_part = None; + } + let mut total_bytes_read = hb + bytes_read; + while total_bytes_read < buf.len() && !self.is_depleted() { + match self.read(&mut buf[total_bytes_read ..]) { + Ok(br) => total_bytes_read += br, + Err(err) => return Err(err), + } + } + Ok(total_bytes_read) + } + Err(err) => { + // fail permanently + self.current_part = None; + self.last_part_boundary = None; + self.raw_parts.clear(); + Err(err) + } + } + } +} + +// The following macro invocation needs to be expanded, as `include!` +// doens't support external macros +// header!{ +// #[doc="The `X-Upload-Content-Type` header."] +// (XUploadContentType, "X-Upload-Content-Type") => [Mime] + +// xupload_content_type { +// test_header!( +// test1, +// vec![b"text/plain"], +// Some(HeaderField( +// vec![Mime(TopLevel::Text, SubLevel::Plain, Vec::new())] +// ))); + +// } +// } + +/// The `X-Upload-Content-Type` header. +/// +/// Generated via rustc --pretty expanded -Z unstable-options, and manually +/// processed to be more readable. +#[derive(PartialEq, Debug, Clone)] +pub struct XUploadContentType(pub Mime); + +impl ::std::ops::Deref for XUploadContentType { + type Target = Mime; + fn deref<'a>(&'a self) -> &'a Mime { &self.0 } +} +impl ::std::ops::DerefMut for XUploadContentType { + fn deref_mut<'a>(&'a mut self) -> &'a mut Mime { &mut self.0 } +} +impl Header for XUploadContentType { + fn header_name() -> &'static str { "X-Upload-Content-Type" } + fn parse_header(raw: &[Vec]) -> hyper::error::Result { + hyper::header::parsing::from_one_raw_str(raw).map(XUploadContentType) + } +} +impl HeaderFormat for XUploadContentType { + fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result { + Display::fmt(&**self, f) + } +} +impl Display for XUploadContentType { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&**self, f) + } +} + +#[derive(Clone, PartialEq, Debug)] +pub struct Chunk { + pub first: u64, + pub last: u64 +} + +impl fmt::Display for Chunk { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + (write!(fmt, "{}-{}", self.first, self.last)).ok(); + Ok(()) + } +} + +impl FromStr for Chunk { + type Err = &'static str; + + /// NOTE: only implements `%i-%i`, not `*` + fn from_str(s: &str) -> std::result::Result { + let parts: Vec<&str> = s.split('-').collect(); + if parts.len() != 2 { + return Err("Expected two parts: %i-%i") + } + Ok( + Chunk { + first: match FromStr::from_str(parts[0]) { + Ok(d) => d, + _ => return Err("Couldn't parse 'first' as digit") + }, + last: match FromStr::from_str(parts[1]) { + Ok(d) => d, + _ => return Err("Couldn't parse 'last' as digit") + } + } + ) + } +} + +/// Implements the Content-Range header, for serialization only +#[derive(Clone, PartialEq, Debug)] +pub struct ContentRange { + pub range: Option, + pub total_length: u64, +} + +impl Header for ContentRange { + fn header_name() -> &'static str { + "Content-Range" + } + + /// We are not parsable, as parsing is done by the `Range` header + fn parse_header(_: &[Vec]) -> hyper::error::Result { + Err(hyper::error::Error::Method) + } +} + + +impl HeaderFormat for ContentRange { + fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + try!(fmt.write_str("bytes ")); + match self.range { + Some(ref c) => try!(c.fmt(fmt)), + None => try!(fmt.write_str("*")) + } + (write!(fmt, "/{}", self.total_length)).ok(); + Ok(()) + } +} + +#[derive(Clone, PartialEq, Debug)] +pub struct RangeResponseHeader(pub Chunk); + +impl Header for RangeResponseHeader { + fn header_name() -> &'static str { + "Range" + } + + 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 Ok(RangeResponseHeader(c)) + } + } + } + } + Err(hyper::error::Error::Method) + } +} + +impl HeaderFormat for RangeResponseHeader { + /// No implmentation necessary, we just need to parse + fn fmt_header(&self, _: &mut fmt::Formatter) -> fmt::Result { + Err(fmt::Error) + } +} + +/// A utility type to perform a resumable upload from start to end. +pub struct ResumableUploadHelper<'a, A: 'a> { + pub client: &'a mut hyper::client::Client, + pub delegate: &'a mut Delegate, + pub start_at: Option, + pub auth: &'a mut A, + pub user_agent: &'a str, + pub auth_header: Authorization, + pub url: &'a str, + pub reader: &'a mut ReadSeek, + pub media_type: Mime, + pub content_length: u64 +} + +impl<'a, A> ResumableUploadHelper<'a, A> + where A: oauth2::GetToken { + + fn query_transfer_status(&mut self) -> std::result::Result> { + loop { + match self.client.post(self.url) + .header(UserAgent(self.user_agent.to_string())) + .header(ContentRange { range: None, total_length: self.content_length }) + .header(self.auth_header.clone()) + .send() { + Ok(r) => { + // 308 = resume-incomplete == PermanentRedirect + let headers = r.headers.clone(); + let h: &RangeResponseHeader = match headers.get() { + Some(hh) if r.status == StatusCode::PermanentRedirect => hh, + None|Some(_) => { + if let Retry::After(d) = self.delegate.http_failure(&r, None, None) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + return Err(Err(err)) + } + } + } + } + + /// returns None if operation was cancelled by delegate, or the HttpResult. + /// It can be that we return the result just because we didn't understand the status code - + /// caller should check for status himself before assuming it's OK to use + pub fn upload(&mut self) -> Option> { + let mut start = match self.start_at { + Some(s) => s, + None => match self.query_transfer_status() { + Ok(s) => s, + Err(result) => return Some(result) + } + }; + + const MIN_CHUNK_SIZE: u64 = 1 << 18; + let chunk_size = match self.delegate.chunk_size() { + cs if cs > MIN_CHUNK_SIZE => cs, + _ => MIN_CHUNK_SIZE + }; + + self.reader.seek(SeekFrom::Start(start)).unwrap(); + loop { + let request_size = match self.content_length - start { + rs if rs > chunk_size => chunk_size, + rs => rs + }; + + let mut section_reader = self.reader.take(request_size); + let range_header = ContentRange { + range: Some(Chunk {first: start, last: start + request_size - 1}), + total_length: self.content_length + }; + start += request_size; + if self.delegate.cancel_chunk_upload(&range_header) { + return None + } + // workaround https://github.com/rust-lang/rust/issues/22252 + let res = self.client.post(self.url) + .header(range_header) + .header(ContentType(self.media_type.clone())) + .header(UserAgent(self.user_agent.to_string())) + .body(&mut section_reader) + .send(); + match res { + Ok(mut res) => { + if res.status == StatusCode::PermanentRedirect { + continue + } + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let Retry::After(d) = self.delegate.http_failure(&res, + serde::json::from_str(&json_err).ok(), + serde::json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + return Some(Err(err)) + } + } + } + } +} + +// Copy of src/rust/cli/cmn.rs +// TODO(ST): Allow sharing common code between program types +pub fn remove_json_null_values(value: &mut serde::json::value::Value) { + match *value { + serde::json::value::Value::Object(ref mut map) => { + let mut for_removal = Vec::new(); + + for (key, mut value) in map.iter_mut() { + if value.is_null() { + for_removal.push(key.clone()); + } else { + remove_json_null_values(&mut value); + } + } + + for key in &for_removal { + map.remove(key); + } + } + _ => {} + } +} diff --git a/gen/cloudresourcemanager1_beta1/src/lib.rs b/gen/cloudresourcemanager1_beta1/src/lib.rs new file mode 100644 index 0000000000..9efdb64868 --- /dev/null +++ b/gen/cloudresourcemanager1_beta1/src/lib.rs @@ -0,0 +1,185 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *cloudresourcemanager* crate version *0.1.8+20150603*, where *20150603* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! +//! Everything else about the *cloudresourcemanager* *v1_beta1* API can be found at the +//! [official documentation site](https://cloud.google.com/resource-manager). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1_beta1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.Cloudresourcemanager.html) ... +//! +//! * [projects](struct.Project.html) +//! * [*create*](struct.ProjectCreateCall.html), [*delete*](struct.ProjectDeleteCall.html), [*get*](struct.ProjectGetCall.html), [*list*](struct.ProjectListCall.html), [*undelete*](struct.ProjectUndeleteCall.html) and [*update*](struct.ProjectUpdateCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](../index.html). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.Cloudresourcemanager.html)** +//! * a central object to maintain state and allow accessing all *Activities* +//! * creates [*Method Builders*](trait.MethodsBuilder.html) which in turn +//! allow access to individual [*Call Builders*](trait.CallBuilder.html) +//! * **[Resources](trait.Resource.html)** +//! * primary types that you can apply *Activities* to +//! * a collection of properties and *Parts* +//! * **[Parts](trait.Part.html)** +//! * a collection of properties +//! * never directly used in *Activities* +//! * **[Activities](trait.CallBuilder.html)** +//! * operations to apply to *Resources* +//! +//! All *structures* are marked with applicable traits to further categorize them and ease browsing. +//! +//! Generally speaking, you can invoke *Activities* like this: +//! +//! ```Rust,ignore +//! let r = hub.resource().activity(...).doit() +//! ``` +//! +//! Or specifically ... +//! +//! ```ignore +//! let r = hub.projects().delete(...).doit() +//! let r = hub.projects().undelete(...).doit() +//! let r = hub.projects().get(...).doit() +//! let r = hub.projects().update(...).doit() +//! let r = hub.projects().create(...).doit() +//! let r = hub.projects().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 +//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired. +//! The `doit()` method performs the actual communication with the server and returns the respective result. +//! +//! # Usage +//! +//! ## Setting up your Project +//! +//! To use this library, you would put the following lines into your `Cargo.toml` file: +//! +//! ```toml +//! [dependencies] +//! google-cloudresourcemanager1_beta1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_cloudresourcemanager1_beta1 as cloudresourcemanager1_beta1; +//! use cloudresourcemanager1_beta1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use cloudresourcemanager1_beta1::Cloudresourcemanager; +//! +//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and +//! // `client_secret`, among other things. +//! let secret: ApplicationSecret = Default::default(); +//! // Instantiate the authenticator. It will choose a suitable authentication flow for you, +//! // unless you replace `None` with the desired Flow. +//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +//! // retrieve them from storage. +//! let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +//! hyper::Client::new(), +//! ::default(), None); +//! let mut hub = Cloudresourcemanager::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.projects().list() +//! .page_token("sea") +//! .page_size(-90) +//! .filter("dolores") +//! .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 +//! the doit() methods, or handed as possibly intermediate results to either the +//! [Hub Delegate](trait.Delegate.html), or the [Authenticator Delegate](../yup-oauth2/trait.AuthenticatorDelegate.html). +//! +//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This +//! makes the system potentially resilient to all kinds of errors. +//! +//! ## Uploads and Downloads +//! If a method supports downloads, the response body, which is part of the [Result](enum.Result.html), should be +//! read by you to obtain the media. +//! If such a method also supports a [Response Result](trait.ResponseResult.html), it will return that by default. +//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making +//! this call: `.param("alt", "media")`. +//! +//! Methods supporting uploads can do so using up to 2 different protocols: +//! *simple* and *resumable*. The distinctiveness of each is represented by customized +//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively. +//! +//! ## Customization and Callbacks +//! +//! You may alter the way an `doit()` method is called by providing a [delegate](trait.Delegate.html) to the +//! [Method Builder](trait.CallBuilder.html) before making the final `doit()` call. +//! Respective methods will be called to provide progress information, as well as determine whether the system should +//! retry on failure. +//! +//! The [delegate trait](trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +//! +//! ## Optional Parts in Server-Requests +//! +//! All structures provided by this library are made to be [enocodable](trait.RequestValue.html) and +//! [decodable](trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +//! are valid. +//! Most optionals are are considered [Parts](trait.Part.html) which are identifiable by name, which will be sent to +//! the server to indicate either the set parts of the request or the desired parts in the response. +//! +//! ## Builder Arguments +//! +//! Using [method builders](trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +//! These will always take a single argument, for which the following statements are true. +//! +//! * [PODs][wiki-pod] are handed by copy +//! * strings are passed as `&str` +//! * [request values](trait.RequestValue.html) are moved +//! +//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times. +//! +//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure +//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern +//! [google-go-api]: https://github.com/google/google-api-go-client +//! +//! + +// Unused attributes happen thanks to defined, but unused structures +// We don't warn about this, as depending on the API, some data structures or facilities are never used. +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// unused imports in fully featured APIs. Same with unused_mut ... . +#![allow(unused_imports, unused_mut, dead_code)] + +include!(concat!(env!("OUT_DIR"), "/lib.rs")); \ No newline at end of file diff --git a/gen/cloudresourcemanager1_beta1/src/lib.rs.in b/gen/cloudresourcemanager1_beta1/src/lib.rs.in new file mode 100644 index 0000000000..6758dba347 --- /dev/null +++ b/gen/cloudresourcemanager1_beta1/src/lib.rs.in @@ -0,0 +1,1867 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.in.mako' +// DO NOT EDIT ! + +extern crate hyper; +extern crate serde; +extern crate yup_oauth2 as oauth2; +extern crate mime; +extern crate url; + +mod cmn; + +use std::collections::HashMap; +use std::cell::RefCell; +use std::borrow::BorrowMut; +use std::default::Default; +use std::collections::BTreeMap; +use serde::json; +use std::io; +use std::fs; +use std::thread::sleep_ms; + +pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, Hub, ReadSeek, Part, + ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder, + Resource, ErrorResponse, remove_json_null_values}; + + +// ############## +// 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 { + /// View and manage your data across Google Cloud Platform services + CloudPlatform, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::CloudPlatform + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all Cloudresourcemanager related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudresourcemanager1_beta1 as cloudresourcemanager1_beta1; +/// use cloudresourcemanager1_beta1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudresourcemanager1_beta1::Cloudresourcemanager; +/// +/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and +/// // `client_secret`, among other things. +/// let secret: ApplicationSecret = Default::default(); +/// // Instantiate the authenticator. It will choose a suitable authentication flow for you, +/// // unless you replace `None` with the desired Flow. +/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +/// // retrieve them from storage. +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Cloudresourcemanager::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.projects().list() +/// .page_token("sed") +/// .page_size(-85) +/// .filter("dolores") +/// .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 Cloudresourcemanager { + client: RefCell, + auth: RefCell, + _user_agent: String, +} + +impl<'a, C, A> Hub for Cloudresourcemanager {} + +impl<'a, C, A> Cloudresourcemanager + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> Cloudresourcemanager { + Cloudresourcemanager { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/0.1.8".to_string(), + } + } + + pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { + ProjectMethods { 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`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + let prev = self._user_agent.clone(); + self._user_agent = agent_name; + prev + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// 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. +/// +/// # 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 projects](struct.ProjectDeleteCall.html) (none) +/// * [undelete projects](struct.ProjectUndeleteCall.html) (none) +/// * [get projects](struct.ProjectGetCall.html) (response) +/// * [update projects](struct.ProjectUpdateCall.html) (request|response) +/// * [create projects](struct.ProjectCreateCall.html) (request|response) +/// * [list projects](struct.ProjectListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Project { + /// 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. + pub name: Option, + /// 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. + #[serde(rename="projectId")] + pub project_id: Option, + /// 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. + pub labels: Option>, + /// The number uniquely identifying the project. Example: 415104041262. Read-only. + #[serde(rename="projectNumber")] + pub project_number: Option, + /// Creation time. Read-only. + #[serde(rename="createTime")] + pub create_time: Option, + /// The project lifecycle state. Read-only. + #[serde(rename="lifecycleState")] + pub lifecycle_state: Option, +} + +impl RequestValue for Project {} +impl Resource for Project {} +impl ResponseResult for Project {} + + +/// 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. +/// +/// # 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 projects](struct.ProjectListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListProjectsResponse { + /// Pagination token. If the result set is too large to fit in a single response, this token is returned. It encodes the position of the current result cursor. Feeding this value into a new list request with the `page_token` parameter gives the next page of the results. When `next_page_token` is not filled in, there is no next page and the list returned is the last page in the result set. Pagination tokens have a limited lifetime. Note: pagination is not yet supported; the server will not set this field. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of projects that matched the list filter. This list can be paginated. + pub projects: Option>, +} + +impl ResponseResult for ListProjectsResponse {} + + +/// 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); } +/// +/// # 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 projects](struct.ProjectDeleteCall.html) (response) +/// * [undelete projects](struct.ProjectUndeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty; + +impl ResponseResult for Empty {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `Cloudresourcemanager` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudresourcemanager1_beta1 as cloudresourcemanager1_beta1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudresourcemanager1_beta1::Cloudresourcemanager; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Cloudresourcemanager::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `create(...)`, `delete(...)`, `get(...)`, `list(...)`, `undelete(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Cloudresourcemanager, +} + +impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} + +impl<'a, C, A> ProjectMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// 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. + /// + /// # Arguments + /// + /// * `projectId` - The project ID (for example, `foo-bar-123`). Required. + pub fn delete(&self, project_id: &str) -> ProjectDeleteCall<'a, C, A> { + ProjectDeleteCall { + hub: self.hub, + _project_id: project_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// 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. + /// + /// # Arguments + /// + /// * `projectId` - The project ID (for example, `foo-bar-123`). Required. + pub fn undelete(&self, project_id: &str) -> ProjectUndeleteCall<'a, C, A> { + ProjectUndeleteCall { + hub: self.hub, + _project_id: project_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this project. + /// + /// # Arguments + /// + /// * `projectId` - The project ID (for example, `my-project-123`). Required. + pub fn get(&self, project_id: &str) -> ProjectGetCall<'a, C, A> { + ProjectGetCall { + hub: self.hub, + _project_id: project_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the attributes of the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have modify permissions for this project. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The project ID (for example, `my-project-123`). Required. + pub fn update(&self, request: Project, project_id: &str) -> ProjectUpdateCall<'a, C, A> { + ProjectUpdateCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a project resource. Initially, the project resource is owned by its creator exclusively. The creator can later grant permission to others to read or update the project. Several APIs are activated automatically for the project, including Google Cloud Storage. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: Project) -> ProjectCreateCall<'a, C, A> { + ProjectCreateCall { + 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: + /// + /// Lists projects that are visible to the user and satisfy the specified filter. This method returns projects in an unspecified order. New projects do not necessarily appear at the end of the list. + pub fn list(&self) -> ProjectListCall<'a, C, A> { + ProjectListCall { + hub: self.hub, + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// 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. +/// +/// A builder for the *delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1_beta1 as cloudresourcemanager1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1_beta1::Cloudresourcemanager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Cloudresourcemanager::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.projects().delete("projectId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Cloudresourcemanager, + _project_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectDeleteCall<'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: "cloudresourcemanager.projects.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + for &field in ["alt", "projectId"].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://cloudresourcemanager.googleapis.com/v1beta1/projects/{projectId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId")].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 ["projectId"].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 project ID (for example, `foo-bar-123`). Required. + /// + /// Sets the *project 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 project_id(mut self, new_value: &str) -> ProjectDeleteCall<'a, C, A> { + self._project_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) -> ProjectDeleteCall<'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) -> ProjectDeleteCall<'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) -> ProjectDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// 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. +/// +/// A builder for the *undelete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1_beta1 as cloudresourcemanager1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1_beta1::Cloudresourcemanager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Cloudresourcemanager::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.projects().undelete("projectId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectUndeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Cloudresourcemanager, + _project_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectUndeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectUndeleteCall<'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: "cloudresourcemanager.projects.undelete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + for &field in ["alt", "projectId"].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://cloudresourcemanager.googleapis.com/v1beta1/projects/{projectId}:undelete".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId")].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 ["projectId"].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::Post, &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 project ID (for example, `foo-bar-123`). Required. + /// + /// Sets the *project 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 project_id(mut self, new_value: &str) -> ProjectUndeleteCall<'a, C, A> { + self._project_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) -> ProjectUndeleteCall<'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) -> ProjectUndeleteCall<'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) -> ProjectUndeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this project. +/// +/// A builder for the *get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1_beta1 as cloudresourcemanager1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1_beta1::Cloudresourcemanager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Cloudresourcemanager::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.projects().get("projectId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Cloudresourcemanager, + _project_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectGetCall<'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, Project)> { + 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: "cloudresourcemanager.projects.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + for &field in ["alt", "projectId"].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://cloudresourcemanager.googleapis.com/v1beta1/projects/{projectId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId")].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 ["projectId"].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 project ID (for example, `my-project-123`). Required. + /// + /// Sets the *project 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 project_id(mut self, new_value: &str) -> ProjectGetCall<'a, C, A> { + self._project_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) -> ProjectGetCall<'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) -> ProjectGetCall<'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) -> ProjectGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates the attributes of the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have modify permissions for this project. +/// +/// A builder for the *update* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1_beta1 as cloudresourcemanager1_beta1; +/// use cloudresourcemanager1_beta1::Project; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1_beta1::Cloudresourcemanager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Cloudresourcemanager::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 = Project::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.projects().update(req, "projectId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Cloudresourcemanager, + _request: Project, + _project_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectUpdateCall<'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, Project)> { + 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: "cloudresourcemanager.projects.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + for &field in ["alt", "projectId"].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://cloudresourcemanager.googleapis.com/v1beta1/projects/{projectId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId")].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 ["projectId"].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::Put, &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: Project) -> ProjectUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID (for example, `my-project-123`). Required. + /// + /// Sets the *project 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 project_id(mut self, new_value: &str) -> ProjectUpdateCall<'a, C, A> { + self._project_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) -> ProjectUpdateCall<'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) -> ProjectUpdateCall<'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) -> ProjectUpdateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates a project resource. Initially, the project resource is owned by its creator exclusively. The creator can later grant permission to others to read or update the project. Several APIs are activated automatically for the project, including Google Cloud Storage. +/// +/// A builder for the *create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1_beta1 as cloudresourcemanager1_beta1; +/// use cloudresourcemanager1_beta1::Project; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1_beta1::Cloudresourcemanager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Cloudresourcemanager::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 = Project::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.projects().create(req) +/// .doit(); +/// # } +/// ``` +pub struct ProjectCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Cloudresourcemanager, + _request: Project, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectCreateCall<'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, Project)> { + 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: "cloudresourcemanager.projects.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://cloudresourcemanager.googleapis.com/v1beta1/projects".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: Project) -> ProjectCreateCall<'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) -> ProjectCreateCall<'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) -> ProjectCreateCall<'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) -> ProjectCreateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists projects that are visible to the user and satisfy the specified filter. This method returns projects in an unspecified order. New projects do not necessarily appear at the end of the list. +/// +/// A builder for the *list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1_beta1 as cloudresourcemanager1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1_beta1::Cloudresourcemanager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Cloudresourcemanager::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.projects().list() +/// .page_token("amet.") +/// .page_size(-81) +/// .filter("labore") +/// .doit(); +/// # } +/// ``` +pub struct ProjectListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Cloudresourcemanager, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectListCall<'a, C, A> {} + +impl<'a, C, A> ProjectListCall<'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, ListProjectsResponse)> { + 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: "cloudresourcemanager.projects.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._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", "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://cloudresourcemanager.googleapis.com/v1beta1/projects".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)); + } + + + + 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) + } + } + } + } + + + /// A pagination token returned from a previous call to ListProject that indicates from where listing should continue. Note: pagination is not yet supported; the server ignores this field. Optional. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of Projects to return in the response. The server can return fewer projects than requested. If unspecified, server picks an appropriate default. Note: pagination is not yet supported; the server ignores this field. Optional. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// 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:* ==> 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. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectListCall<'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) -> ProjectListCall<'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) -> ProjectListCall<'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) -> ProjectListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + diff --git a/gen/compute1-cli/Cargo.toml b/gen/compute1-cli/Cargo.toml index f1dd9cdd10..cf0db42cf5 100644 --- a/gen/compute1-cli/Cargo.toml +++ b/gen/compute1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-compute1-cli" -version = "0.3.0+20150326" +version = "0.3.0+20150305" authors = ["Sebastian Thiel "] description = "A complete library to interact with compute (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/compute1-cli" @@ -17,8 +17,8 @@ keywords = ["compute", "google", "cli"] name = "compute1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/compute1-cli/README.md b/gen/compute1-cli/README.md index 7621665500..048ff48e4b 100644 --- a/gen/compute1-cli/README.md +++ b/gen/compute1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *compute* API at revision *20150326*. The CLI is at version *0.3.0*. +This documentation was generated from the *compute* API at revision *20150305*. The CLI is at version *0.3.0*. ```bash compute1 [options] diff --git a/gen/compute1-cli/mkdocs.yml b/gen/compute1-cli/mkdocs.yml index 4291cc5dc1..86fdf7d1d8 100644 --- a/gen/compute1-cli/mkdocs.yml +++ b/gen/compute1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: compute v0.3.0+20150326 +site_name: compute v0.3.0+20150305 site_url: http://byron.github.io/google-apis-rs/google-compute1-cli site_description: Write integrating applications with bcore diff --git a/gen/compute1-cli/src/main.rs b/gen/compute1-cli/src/main.rs index 0872ad43e7..e91a9807dd 100644 --- a/gen/compute1-cli/src/main.rs +++ b/gen/compute1-cli/src/main.rs @@ -99,6 +99,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -150,6 +151,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -201,6 +203,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -294,6 +297,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -355,6 +359,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -406,6 +411,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -457,6 +463,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -541,6 +548,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -636,6 +644,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -697,6 +706,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -792,6 +802,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -887,6 +898,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -948,6 +960,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -999,6 +1012,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1060,6 +1074,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1121,6 +1136,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1217,6 +1233,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1268,6 +1285,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1319,6 +1337,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1351,21 +1370,24 @@ impl<'n, 'a> Engine<'n, 'a> { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-snapshot" => Some(("sourceSnapshot", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-detach-timestamp" => Some(("lastDetachTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "size-gb" => Some(("sizeGb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "options" => Some(("options", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-image-id" => Some(("sourceImageId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-snapshot-id" => Some(("sourceSnapshotId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-attach-timestamp" => Some(("lastAttachTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "options" => Some(("options", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-image" => Some(("sourceImage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "licenses" => Some(("licenses", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "users" => Some(("users", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "id", "kind", "licenses", "name", "options", "self-link", "size-gb", "source-image", "source-image-id", "source-snapshot", "source-snapshot-id", "status", "type", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "id", "kind", "last-attach-timestamp", "last-detach-timestamp", "licenses", "name", "options", "self-link", "size-gb", "source-image", "source-image-id", "source-snapshot", "source-snapshot-id", "status", "type", "users", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1422,6 +1444,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1483,6 +1506,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1534,6 +1558,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1585,6 +1610,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1678,6 +1704,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1739,6 +1766,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1832,6 +1860,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1925,6 +1954,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1986,6 +2016,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2037,6 +2068,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2088,6 +2120,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2182,6 +2215,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2243,6 +2277,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2327,6 +2362,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2378,6 +2414,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2429,6 +2466,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2522,6 +2560,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2583,6 +2622,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2634,6 +2674,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2685,6 +2726,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2779,6 +2821,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2840,6 +2883,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2924,6 +2968,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2985,6 +3030,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3080,6 +3126,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3141,6 +3188,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3192,6 +3240,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3243,6 +3292,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3339,6 +3389,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3400,6 +3451,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3496,6 +3548,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3592,6 +3645,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3643,6 +3697,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3731,6 +3786,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3782,6 +3838,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3886,6 +3943,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3947,6 +4005,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3998,6 +4057,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4049,6 +4109,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4087,6 +4148,7 @@ impl<'n, 'a> Engine<'n, 'a> { "properties.tags.items" => Some(("properties.tags.items", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "properties.tags.fingerprint" => Some(("properties.tags.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties.scheduling.automatic-restart" => Some(("properties.scheduling.automaticRestart", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "properties.scheduling.preemptible" => Some(("properties.scheduling.preemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "properties.scheduling.on-host-maintenance" => Some(("properties.scheduling.onHostMaintenance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties.can-ip-forward" => Some(("properties.canIpForward", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "properties.metadata.kind" => Some(("properties.metadata.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -4094,7 +4156,7 @@ impl<'n, 'a> Engine<'n, 'a> { "self-link" => Some(("selfLink", 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!["automatic-restart", "can-ip-forward", "creation-timestamp", "description", "fingerprint", "id", "items", "kind", "machine-type", "metadata", "name", "on-host-maintenance", "properties", "scheduling", "self-link", "tags"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["automatic-restart", "can-ip-forward", "creation-timestamp", "description", "fingerprint", "id", "items", "kind", "machine-type", "metadata", "name", "on-host-maintenance", "preemptible", "properties", "scheduling", "self-link", "tags"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4147,6 +4209,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4208,6 +4271,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4295,6 +4359,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4356,6 +4421,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4453,6 +4519,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4504,6 +4571,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4555,6 +4623,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4606,6 +4675,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4657,6 +4727,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4712,6 +4783,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4751,6 +4823,7 @@ impl<'n, 'a> Engine<'n, 'a> { "tags.fingerprint" => Some(("tags.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status-message" => Some(("statusMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "scheduling.automatic-restart" => Some(("scheduling.automaticRestart", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "scheduling.preemptible" => Some(("scheduling.preemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "scheduling.on-host-maintenance" => Some(("scheduling.onHostMaintenance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "machine-type" => Some(("machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metadata.kind" => Some(("metadata.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -4760,7 +4833,7 @@ impl<'n, 'a> Engine<'n, 'a> { "self-link" => Some(("selfLink", 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!["automatic-restart", "can-ip-forward", "cpu-platform", "creation-timestamp", "description", "fingerprint", "id", "items", "kind", "machine-type", "metadata", "name", "on-host-maintenance", "scheduling", "self-link", "status", "status-message", "tags", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["automatic-restart", "can-ip-forward", "cpu-platform", "creation-timestamp", "description", "fingerprint", "id", "items", "kind", "machine-type", "metadata", "name", "on-host-maintenance", "preemptible", "scheduling", "self-link", "status", "status-message", "tags", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4813,6 +4886,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4874,6 +4948,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4925,6 +5000,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4977,6 +5053,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5062,6 +5139,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5092,9 +5170,10 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "automatic-restart" => Some(("automaticRestart", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "preemptible" => Some(("preemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "on-host-maintenance" => Some(("onHostMaintenance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["automatic-restart", "on-host-maintenance"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["automatic-restart", "on-host-maintenance", "preemptible"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5147,6 +5226,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5232,6 +5312,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5283,6 +5364,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5334,6 +5416,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5385,6 +5468,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5446,6 +5530,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5497,6 +5582,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5558,6 +5644,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5609,6 +5696,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5660,6 +5748,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5751,6 +5840,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5812,6 +5902,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5863,6 +5954,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5948,6 +6040,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6033,6 +6126,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6118,6 +6212,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6203,6 +6298,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6298,6 +6394,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6359,6 +6456,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6410,6 +6508,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6471,6 +6570,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6522,6 +6622,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6573,6 +6674,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6671,6 +6773,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6732,6 +6835,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6783,6 +6887,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6834,6 +6939,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6895,6 +7001,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6946,6 +7053,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6997,6 +7105,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7087,6 +7196,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7148,6 +7258,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7232,6 +7343,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7293,6 +7405,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7344,6 +7457,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7395,6 +7509,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7487,6 +7602,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7548,6 +7664,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7631,6 +7748,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7714,6 +7832,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7775,6 +7894,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7826,6 +7946,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7877,6 +7998,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7961,6 +8083,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8056,6 +8179,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8117,6 +8241,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8200,6 +8325,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8283,6 +8409,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8371,6 +8498,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8432,6 +8560,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8483,6 +8612,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8534,6 +8664,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8628,6 +8759,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8689,6 +8821,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8740,6 +8873,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8791,6 +8925,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8882,6 +9017,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8943,6 +9079,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9034,6 +9171,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9125,6 +9263,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9216,6 +9355,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9277,6 +9417,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9328,6 +9469,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9379,6 +9521,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9477,6 +9620,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9538,6 +9682,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9633,6 +9778,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9694,6 +9840,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9745,6 +9892,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9806,6 +9954,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -10521,7 +10670,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() @@ -10534,7 +10683,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() @@ -12262,18 +12411,18 @@ fn main() { ("instance-templates", "methods: 'delete', 'get', 'insert' and 'list'", vec![ ("delete", - Some(r##"Deletes the specified instance template resource."##), + Some(r##"Deletes the specified instance template."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-templates_delete", vec![ (Some(r##"project"##), None, - Some(r##"Name of the project scoping this request."##), + Some(r##"The project ID for this request."##), Some(true), Some(false)), (Some(r##"instance-template"##), None, - Some(r##"Name of the instance template resource to delete."##), + Some(r##"The name of the instance template to delete."##), Some(true), Some(false)), @@ -12295,13 +12444,13 @@ fn main() { vec![ (Some(r##"project"##), None, - Some(r##"Name of the project scoping this request."##), + Some(r##"The project ID for this request."##), Some(true), Some(false)), (Some(r##"instance-template"##), None, - Some(r##"Name of the instance template resource to return."##), + Some(r##"The name of the instance template."##), Some(true), Some(false)), @@ -12318,12 +12467,12 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Creates an instance template resource in the specified project using the data included in the request."##), + Some(r##"Creates an instance template in the specified project using the data that is included in the request."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-templates_insert", vec![ (Some(r##"project"##), None, - Some(r##"Name of the project scoping this request."##), + Some(r##"The project ID for this request."##), Some(true), Some(false)), @@ -12346,12 +12495,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Retrieves the list of instance template resources contained within the specified project."##), + Some(r##"Retrieves a list of instance templates that are contained within the specified project and zone."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-templates_list", vec![ (Some(r##"project"##), None, - Some(r##"Name of the project scoping this request."##), + Some(r##"The project ID for this request."##), Some(true), Some(false)), @@ -12980,7 +13129,7 @@ fn main() { (Some(r##"instance"##), None, - Some(r##"Name of the instance resource to start."##), + Some(r##"Name of the instance resource to stop."##), Some(true), Some(false)), @@ -15062,7 +15211,7 @@ fn main() { let mut app = App::new("compute1") .author("Sebastian Thiel ") - .version("0.3.0+20150326") + .version("0.3.0+20150305") .about("API for the Google Compute Engine service.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_compute1_cli") .arg(Arg::with_name("url") diff --git a/gen/compute1/Cargo.toml b/gen/compute1/Cargo.toml index 72635f6688..d4ed5701a1 100644 --- a/gen/compute1/Cargo.toml +++ b/gen/compute1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-compute1" -version = "0.1.8+20150326" +version = "0.1.8+20150305" authors = ["Sebastian Thiel "] description = "A complete library to interact with compute (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/compute1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/compute1/README.md b/gen/compute1/README.md index ed355eaaba..cdcfac87ce 100644 --- a/gen/compute1/README.md +++ b/gen/compute1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-compute1` library allows access to all features of the *Google compute* service. -This documentation was generated from *compute* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *compute* crate version *0.1.8+20150305*, where *20150305* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *compute* *v1* API can be found at the [official documentation site](https://developers.google.com/compute/docs/reference/latest/). diff --git a/gen/compute1/src/cmn.rs b/gen/compute1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/compute1/src/cmn.rs +++ b/gen/compute1/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/compute1/src/lib.rs b/gen/compute1/src/lib.rs index f75a176049..af39ff3ede 100644 --- a/gen/compute1/src/lib.rs +++ b/gen/compute1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *compute* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *compute* crate version *0.1.8+20150305*, where *20150305* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *compute* *v1* API can be found at the //! [official documentation site](https://developers.google.com/compute/docs/reference/latest/). diff --git a/gen/compute1/src/lib.rs.in b/gen/compute1/src/lib.rs.in index 7c4fce17eb..6350cb0573 100644 --- a/gen/compute1/src/lib.rs.in +++ b/gen/compute1/src/lib.rs.in @@ -443,7 +443,7 @@ pub struct Instance { /// [Output Only] The CPU platform used by this instance. #[serde(rename="cpuPlatform")] pub cpu_platform: Option, - /// [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, TERMINATED. + /// [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, and TERMINATED. pub status: Option, /// Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding. #[serde(rename="canIpForward")] @@ -1263,6 +1263,12 @@ impl Part for DiskTypesScopedList {} /// A BackendService resource. This resource defines a group of backend VMs together with their serving capacity. /// +/// If 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: +/// +/// Converters/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 +/// +/// Tests to update: com.google.cloud.cluster.manager.networking.services.backendservice.BackendServiceResourceConverterTest com.google.cloud.cluster.mixer.protomappers.BackendServiceMappersTest.testResourceMapping +/// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. @@ -1823,21 +1829,21 @@ impl ResponseResult for DiskTypeAggregatedList {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct InstanceTemplate { - /// Type of the resource. + /// [Output Only] The resource type, which is always compute#instanceTemplate for instance templates. pub kind: Option, - /// An optional textual description of the instance template resource; provided by the client when the resource is created. + /// An optional text description for the instance template. pub description: Option, - /// Name of the instance template resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035 + /// The name of the instance template. The name must be 1-63 characters long, and comply with RFC1035. pub name: Option, - /// Creation timestamp in RFC3339 text format (output only). + /// [Output Only] The creation timestamp for this instance template in RFC3339 text format. #[serde(rename="creationTimestamp")] pub creation_timestamp: Option, - /// The instance properties portion of this instance template resource. + /// The instance properties for the instance template resource. pub properties: Option, - /// Server defined URL for the resource (output only). + /// [Output Only] The URL for this instance template. The server defines this URL. #[serde(rename="selfLink")] pub self_link: Option, - /// Unique identifier for the resource; defined by the server (output only). + /// [Output Only] A unique identifier for this instance template. The server defines this identifier. pub id: Option, } @@ -1981,6 +1987,9 @@ pub struct Disk { /// - global/snapshots/snapshot #[serde(rename="sourceSnapshot")] pub source_snapshot: Option, + /// [Output Only] Last detach timestamp in RFC3339 text format. + #[serde(rename="lastDetachTimestamp")] + pub last_detach_timestamp: Option, /// An optional textual description of the resource; provided by the client when the resource is created. pub description: Option, /// The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used. @@ -2004,6 +2013,8 @@ pub struct Disk { /// [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used. #[serde(rename="sourceSnapshotId")] pub source_snapshot_id: Option, + /// Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance + pub users: Option>, /// [Output Only] Creation timestamp in RFC3339 text format. #[serde(rename="creationTimestamp")] pub creation_timestamp: Option, @@ -2020,6 +2031,9 @@ pub struct Disk { pub size_gb: Option, /// [Output Only] URL of the zone where the disk resides. pub zone: Option, + /// [Output Only] Last attach timestamp in RFC3339 text format. + #[serde(rename="lastAttachTimestamp")] + pub last_attach_timestamp: Option, /// URL of the disk type resource describing which disk type to use to create the disk; provided by the client when the disk is created. #[serde(rename="type")] pub type_: Option, @@ -3047,7 +3061,7 @@ pub struct InstanceReference { impl RequestValue for InstanceReference {} -/// Contains a list of instance template resources. +/// A list of instance templates. /// /// # Activities /// @@ -3058,16 +3072,16 @@ impl RequestValue for InstanceReference {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct InstanceTemplateList { - /// A token used to continue a truncated list request (output only). + /// [Output Only] A token that is used to continue a truncated list request. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// A list of InstanceTemplate resources. pub items: Option>, - /// Type of resource. + /// [Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists. pub kind: Option, - /// Unique identifier for the resource; defined by the server (output only). + /// [Output Only] A unique identifier for this instance template. The server defines this identifier. pub id: Option, - /// Server defined URL for this resource (output only). + /// [Output Only] The URL for this instance template list. The server defines this URL. #[serde(rename="selfLink")] pub self_link: Option, } @@ -3267,7 +3281,7 @@ pub struct Route { pub next_hop_instance: Option, /// If potential misconfigurations are detected for this route, this field will be populated with warning messages. pub warnings: Option>, - /// Breaks ties between Routes of equal specificity. Routes with smaller values win when tied with routes with larger values. + /// Breaks ties between Routes of equal specificity. Routes with smaller values win when tied with routes with larger values. Default value is 1000. A valid range is between 0 and 65535. pub priority: Option, /// The URL to a VpnTunnel that should handle matching packets. #[serde(rename="nextHopVpnTunnel")] @@ -3653,7 +3667,7 @@ pub struct Operation { /// [Output Only] The time that this operation was started by the server. This is in RFC3339 text format. #[serde(rename="startTime")] pub start_time: Option, - /// [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project + /// [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project. #[serde(rename="clientOperationId")] pub client_operation_id: Option, /// [Output Only] Creation timestamp in RFC3339 text format. @@ -3678,7 +3692,7 @@ pub struct Operation { /// [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. #[serde(rename="httpErrorMessage")] pub http_error_message: Option, - /// [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should be monotonically increasing as the operation progresses. + /// [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should monotonically increase as the operation progresses. pub progress: Option, /// [Output Only] The time that this operation was completed. This is in RFC3339 text format. #[serde(rename="endTime")] @@ -3748,27 +3762,27 @@ impl ResponseResult for TargetPoolList {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct InstanceProperties { - /// Allows instances created based on this template to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, say true. If unsure, leave this set to false. + /// A boolean that specifies if instances created from this template can send packets with source IP addresses other than their own or receive packets with destination IP addresses other than their own. If you use these instances as an IP gateway or as the next-hop in a Route resource, specify true. Otherwise, specify false. #[serde(rename="canIpForward")] pub can_ip_forward: Option, - /// An optional textual description for the instances created based on the instance template resource; provided by the client when the template is created. + /// An optional text description for the instances that are created from this instance template. pub description: Option, - /// A list of tags to be applied to the instances created based on this template used to identify valid sources or targets for network firewalls. Provided by the client on instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035. + /// A list of tags to apply to the instances that are created from this template. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. pub tags: Option, - /// Array of disks associated with instance created based on this template. + /// An array of disks that are associated with the instances that are created from this template. pub disks: Option>, - /// Scheduling options for the instances created based on this template. + /// A list of scheduling options for the instances that are created from this template. pub scheduling: Option, - /// Name of the machine type resource describing which machine type to use to host the instances created based on this template; provided by the client when the instance template is created. + /// The machine type to use for instances that are created from this template. #[serde(rename="machineType")] pub machine_type: Option, - /// A list of service accounts each with specified scopes, for which access tokens are to be made available to the instances created based on this template, through metadata queries. + /// A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this template. Use metadata queries to obtain the access tokens for these instances. #[serde(rename="serviceAccounts")] pub service_accounts: Option>, - /// Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instances created based based on this template will have no external internet access. + /// An array of network access configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only supported access configuration. If you do not specify any access configurations, the instances that are created from this template will have no external internet access. #[serde(rename="networkInterfaces")] pub network_interfaces: Option>, - /// Metadata key/value pairs assigned to instances created based on this template. Consists of custom metadata or predefined keys; see Instance documentation for more information. + /// The metadata key/value pairs to assign to instances that are created from this template. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. pub metadata: Option, } @@ -4048,6 +4062,8 @@ pub struct Scheduling { /// Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). #[serde(rename="automaticRestart")] pub automatic_restart: Option, + /// Whether the Instance is preemptible. + pub preemptible: Option, /// Defines the maintenance behavior for this instance. The default behavior is MIGRATE. For more information, see Setting maintenance behavior. #[serde(rename="onHostMaintenance")] pub on_host_maintenance: Option, @@ -4106,7 +4122,7 @@ impl ResponseResult for RegionList {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Backend { - /// The multiplier (a value between 0 and 1e6) 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, 1e6]. + /// 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]. #[serde(rename="capacityScaler")] pub capacity_scaler: Option, /// The max RPS of the group. Can be used with either balancing mode, but required if RATE mode. For RATE mode, either maxRate or maxRatePerInstance must be set. @@ -5306,7 +5322,7 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// /// * `project` - Project ID for this request. /// * `zone` - The name of the zone for this request. - /// * `instance` - Name of the instance resource to start. + /// * `instance` - Name of the instance resource to stop. pub fn stop(&self, project: &str, zone: &str, instance: &str) -> InstanceStopCall<'a, C, A> { InstanceStopCall { hub: self.hub, @@ -7473,12 +7489,12 @@ impl<'a, C, A> InstanceTemplateMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified instance template resource. + /// Deletes the specified instance template. /// /// # Arguments /// - /// * `project` - Name of the project scoping this request. - /// * `instanceTemplate` - Name of the instance template resource to delete. + /// * `project` - The project ID for this request. + /// * `instanceTemplate` - The name of the instance template to delete. pub fn delete(&self, project: &str, instance_template: &str) -> InstanceTemplateDeleteCall<'a, C, A> { InstanceTemplateDeleteCall { hub: self.hub, @@ -7496,8 +7512,8 @@ impl<'a, C, A> InstanceTemplateMethods<'a, C, A> { /// /// # Arguments /// - /// * `project` - Name of the project scoping this request. - /// * `instanceTemplate` - Name of the instance template resource to return. + /// * `project` - The project ID for this request. + /// * `instanceTemplate` - The name of the instance template. pub fn get(&self, project: &str, instance_template: &str) -> InstanceTemplateGetCall<'a, C, A> { InstanceTemplateGetCall { hub: self.hub, @@ -7511,11 +7527,11 @@ impl<'a, C, A> InstanceTemplateMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the list of instance template resources contained within the specified project. + /// Retrieves a list of instance templates that are contained within the specified project and zone. /// /// # Arguments /// - /// * `project` - Name of the project scoping this request. + /// * `project` - The project ID for this request. pub fn list(&self, project: &str) -> InstanceTemplateListCall<'a, C, A> { InstanceTemplateListCall { hub: self.hub, @@ -7531,12 +7547,12 @@ impl<'a, C, A> InstanceTemplateMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates an instance template resource in the specified project using the data included in the request. + /// Creates an instance template in the specified project using the data that is included in the request. /// /// # Arguments /// /// * `request` - No description provided. - /// * `project` - Name of the project scoping this request. + /// * `project` - The project ID for this request. pub fn insert(&self, request: InstanceTemplate, project: &str) -> InstanceTemplateInsertCall<'a, C, A> { InstanceTemplateInsertCall { hub: self.hub, @@ -8789,21 +8805,21 @@ impl<'a, C, A> DiskAggregatedListCall<'a, C, A> where C: BorrowMut DiskAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> DiskAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> DiskAggregatedListCall<'a, C, A> { @@ -9073,21 +9089,21 @@ impl<'a, C, A> DiskListCall<'a, C, A> where C: BorrowMut, A: oaut self._zone = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> DiskListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> DiskListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> DiskListCall<'a, C, A> { @@ -10199,21 +10215,21 @@ impl<'a, C, A> AddresseListCall<'a, C, A> where C: BorrowMut, A: self._region = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> AddresseListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> AddresseListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> AddresseListCall<'a, C, A> { @@ -10471,21 +10487,21 @@ impl<'a, C, A> AddresseAggregatedListCall<'a, C, A> where C: BorrowMut AddresseAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> AddresseAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> AddresseAggregatedListCall<'a, C, A> { @@ -12336,21 +12352,21 @@ impl<'a, C, A> UrlMapListCall<'a, C, A> where C: BorrowMut, A: oa self._project = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> UrlMapListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> UrlMapListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> UrlMapListCall<'a, C, A> { @@ -13681,21 +13697,21 @@ impl<'a, C, A> GlobalAddresseListCall<'a, C, A> where C: BorrowMut GlobalAddresseListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> GlobalAddresseListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> GlobalAddresseListCall<'a, C, A> { @@ -14697,21 +14713,21 @@ impl<'a, C, A> SnapshotListCall<'a, C, A> where C: BorrowMut, A: self._project = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> SnapshotListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> SnapshotListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> SnapshotListCall<'a, C, A> { @@ -15477,21 +15493,21 @@ impl<'a, C, A> DiskTypeAggregatedListCall<'a, C, A> where C: BorrowMut DiskTypeAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> DiskTypeAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> DiskTypeAggregatedListCall<'a, C, A> { @@ -15761,21 +15777,21 @@ impl<'a, C, A> DiskTypeListCall<'a, C, A> where C: BorrowMut, A: self._zone = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> DiskTypeListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> DiskTypeListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> DiskTypeListCall<'a, C, A> { @@ -16281,21 +16297,21 @@ impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oaut self._project = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ZoneListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> ZoneListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ZoneListCall<'a, C, A> { @@ -19336,7 +19352,7 @@ impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: self._zone = new_value.to_string(); self } - /// Name of the instance resource to start. + /// Name of the instance resource to stop. /// /// Sets the *instance* path property to the given value. /// @@ -20723,21 +20739,21 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: self._zone = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> InstanceListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { @@ -20993,21 +21009,21 @@ impl<'a, C, A> InstanceAggregatedListCall<'a, C, A> where C: BorrowMut InstanceAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> InstanceAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InstanceAggregatedListCall<'a, C, A> { @@ -22318,21 +22334,21 @@ impl<'a, C, A> BackendServiceListCall<'a, C, A> where C: BorrowMut BackendServiceListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> BackendServiceListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> BackendServiceListCall<'a, C, A> { @@ -23651,21 +23667,21 @@ impl<'a, C, A> NetworkListCall<'a, C, A> where C: BorrowMut, A: o self._project = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> NetworkListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> NetworkListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> NetworkListCall<'a, C, A> { @@ -24419,21 +24435,21 @@ impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut GlobalOperationListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> GlobalOperationListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> GlobalOperationListCall<'a, C, A> { @@ -25176,21 +25192,21 @@ impl<'a, C, A> GlobalOperationAggregatedListCall<'a, C, A> where C: BorrowMut GlobalOperationAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> GlobalOperationAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { @@ -25448,21 +25464,21 @@ impl<'a, C, A> RegionListCall<'a, C, A> where C: BorrowMut, A: oa self._project = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> RegionListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> RegionListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> RegionListCall<'a, C, A> { @@ -25968,21 +25984,21 @@ impl<'a, C, A> ForwardingRuleAggregatedListCall<'a, C, A> where C: BorrowMut ForwardingRuleAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> ForwardingRuleAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { @@ -27082,21 +27098,21 @@ impl<'a, C, A> ForwardingRuleListCall<'a, C, A> where C: BorrowMut ForwardingRuleListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> ForwardingRuleListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { @@ -27626,21 +27642,21 @@ impl<'a, C, A> TargetPoolListCall<'a, C, A> where C: BorrowMut, A self._region = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetPoolListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { @@ -29350,21 +29366,21 @@ impl<'a, C, A> TargetPoolAggregatedListCall<'a, C, A> where C: BorrowMut TargetPoolAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetPoolAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetPoolAggregatedListCall<'a, C, A> { @@ -30734,21 +30750,21 @@ impl<'a, C, A> TargetInstanceListCall<'a, C, A> where C: BorrowMut TargetInstanceListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetInstanceListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetInstanceListCall<'a, C, A> { @@ -31285,21 +31301,21 @@ impl<'a, C, A> TargetInstanceAggregatedListCall<'a, C, A> where C: BorrowMut TargetInstanceAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetInstanceAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetInstanceAggregatedListCall<'a, C, A> { @@ -33119,21 +33135,21 @@ impl<'a, C, A> GlobalForwardingRuleListCall<'a, C, A> where C: BorrowMut GlobalForwardingRuleListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> GlobalForwardingRuleListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> GlobalForwardingRuleListCall<'a, C, A> { @@ -33391,21 +33407,21 @@ impl<'a, C, A> ImageListCall<'a, C, A> where C: BorrowMut, A: oau self._project = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ImageListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> ImageListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ImageListCall<'a, C, A> { @@ -34707,21 +34723,21 @@ impl<'a, C, A> MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut MachineTypeAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> MachineTypeAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> MachineTypeAggregatedListCall<'a, C, A> { @@ -35251,21 +35267,21 @@ impl<'a, C, A> MachineTypeListCall<'a, C, A> where C: BorrowMut, self._zone = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> MachineTypeListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> MachineTypeListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> MachineTypeListCall<'a, C, A> { @@ -35523,21 +35539,21 @@ impl<'a, C, A> TargetVpnGatewayAggregatedListCall<'a, C, A> where C: BorrowMut TargetVpnGatewayAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { @@ -36067,21 +36083,21 @@ impl<'a, C, A> TargetVpnGatewayListCall<'a, C, A> where C: BorrowMut TargetVpnGatewayListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetVpnGatewayListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetVpnGatewayListCall<'a, C, A> { @@ -38709,21 +38725,21 @@ impl<'a, C, A> HttpHealthCheckListCall<'a, C, A> where C: BorrowMut HttpHealthCheckListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> HttpHealthCheckListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> HttpHealthCheckListCall<'a, C, A> { @@ -39576,7 +39592,7 @@ impl<'a, C, A> HttpHealthCheckUpdateCall<'a, C, A> where C: BorrowMut InstanceTemplateDeleteCall<'a, C, A> where C: BorrowMut InstanceTemplateDeleteCall<'a, C, A> where C: BorrowMut InstanceTemplateGetCall<'a, C, A> where C: BorrowMut InstanceTemplateGetCall<'a, C, A> where C: BorrowMut InstanceTemplateGetCall<'a, C, A> where C: BorrowMut InstanceTemplateListCall<'a, C, A> where C: BorrowMut InstanceTemplateListCall<'a, C, A> where C: BorrowMut InstanceTemplateListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> InstanceTemplateListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InstanceTemplateListCall<'a, C, A> { @@ -40344,7 +40360,7 @@ impl<'a, C, A> InstanceTemplateListCall<'a, C, A> where C: BorrowMut InstanceTemplateInsertCall<'a, C, A> where C: BorrowMut TargetHttpProxyListCall<'a, C, A> where C: BorrowMut TargetHttpProxyListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetHttpProxyListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetHttpProxyListCall<'a, C, A> { @@ -42385,21 +42401,21 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut self._zone = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ZoneOperationListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> ZoneOperationListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ZoneOperationListCall<'a, C, A> { @@ -43432,21 +43448,21 @@ impl<'a, C, A> RouteListCall<'a, C, A> where C: BorrowMut, A: oau self._project = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> RouteListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> RouteListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> RouteListCall<'a, C, A> { @@ -45273,21 +45289,21 @@ impl<'a, C, A> FirewallListCall<'a, C, A> where C: BorrowMut, A: self._project = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> FirewallListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> FirewallListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> FirewallListCall<'a, C, A> { @@ -45817,21 +45833,21 @@ impl<'a, C, A> VpnTunnelListCall<'a, C, A> where C: BorrowMut, A: self._region = new_value.to_string(); self } - /// Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> VpnTunnelListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> VpnTunnelListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> VpnTunnelListCall<'a, C, A> { @@ -46628,21 +46644,21 @@ impl<'a, C, A> VpnTunnelAggregatedListCall<'a, C, A> where C: BorrowMut VpnTunnelAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> VpnTunnelAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> VpnTunnelAggregatedListCall<'a, C, A> { @@ -46912,21 +46928,21 @@ impl<'a, C, A> RegionOperationListCall<'a, C, A> where C: BorrowMut RegionOperationListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> RegionOperationListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Optional. Filter expression for filtering listed resources. + /// Filter expression for filtering listed resources. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> RegionOperationListCall<'a, C, A> { diff --git a/gen/container1_beta1-cli/Cargo.toml b/gen/container1_beta1-cli/Cargo.toml index 34e39ae538..256c5eec3e 100644 --- a/gen/container1_beta1-cli/Cargo.toml +++ b/gen/container1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-container1_beta1-cli" -version = "0.3.0+20150420" +version = "0.3.0+20150617" authors = ["Sebastian Thiel "] description = "A complete library to interact with container (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/container1_beta1-cli" @@ -17,8 +17,8 @@ keywords = ["container", "google", "cli"] name = "container1-beta1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/container1_beta1-cli/README.md b/gen/container1_beta1-cli/README.md index 0b566f3360..382a7414a7 100644 --- a/gen/container1_beta1-cli/README.md +++ b/gen/container1_beta1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *container* API at revision *20150420*. The CLI is at version *0.3.0*. +This documentation was generated from the *container* API at revision *20150617*. The CLI is at version *0.3.0*. ```bash container1-beta1 [options] @@ -37,7 +37,6 @@ container1-beta1 [options] zones-clusters-list [-p ]... [-o ] zones-operations-get [-p ]... [-o ] zones-operations-list [-p ]... [-o ] - zones-tokens-get [-p ]... [-o ] container1-beta1 --help Configuration: diff --git a/gen/container1_beta1-cli/mkdocs.yml b/gen/container1_beta1-cli/mkdocs.yml index 3743658a93..b8f06fb613 100644 --- a/gen/container1_beta1-cli/mkdocs.yml +++ b/gen/container1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: container v0.3.0+20150420 +site_name: container v0.3.0+20150617 site_url: http://byron.github.io/google-apis-rs/google-container1_beta1-cli site_description: Write integrating applications with bcore @@ -17,7 +17,6 @@ pages: - ['projects_zones-clusters-list.md', 'Projects', 'Zones Clusters List'] - ['projects_zones-operations-get.md', 'Projects', 'Zones Operations Get'] - ['projects_zones-operations-list.md', 'Projects', 'Zones Operations List'] -- ['projects_zones-tokens-get.md', 'Projects', 'Zones Tokens Get'] theme: readthedocs diff --git a/gen/container1_beta1-cli/src/main.rs b/gen/container1_beta1-cli/src/main.rs index 92b9fb4cf6..b02fac57b9 100644 --- a/gen/container1_beta1-cli/src/main.rs +++ b/gen/container1_beta1-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -140,6 +141,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -172,25 +174,30 @@ impl<'n, 'a> Engine<'n, 'a> { "cluster.status" => Some(("cluster.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.container-ipv4-cidr" => Some(("cluster.containerIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.description" => Some(("cluster.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "cluster.zone" => Some(("cluster.zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.name" => Some(("cluster.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.num-nodes" => Some(("cluster.numNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster.node-routing-prefix-size" => Some(("cluster.nodeRoutingPrefixSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "cluster.instance-group-urls" => Some(("cluster.instanceGroupUrls", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cluster.services-ipv4-cidr" => Some(("cluster.servicesIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.master-auth.bearer-token" => Some(("cluster.masterAuth.bearerToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "cluster.master-auth.password" => Some(("cluster.masterAuth.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.master-auth.client-key" => Some(("cluster.masterAuth.clientKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.master-auth.client-certificate" => Some(("cluster.masterAuth.clientCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.master-auth.user" => Some(("cluster.masterAuth.user", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.master-auth.password" => Some(("cluster.masterAuth.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.master-auth.cluster-ca-certificate" => Some(("cluster.masterAuth.clusterCaCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.cluster-api-version" => Some(("cluster.clusterApiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.network" => Some(("cluster.network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.endpoint" => Some(("cluster.endpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.machine-type" => Some(("cluster.nodeConfig.machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.source-image" => Some(("cluster.nodeConfig.sourceImage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.status-message" => Some(("cluster.statusMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "cluster.services-ipv4-cidr" => Some(("cluster.servicesIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.zone" => Some(("cluster.zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.creation-timestamp" => Some(("cluster.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.enable-cloud-logging" => Some(("cluster.enableCloudLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.self-link" => Some(("cluster.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "cluster.name" => Some(("cluster.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.enable-cloud-monitoring" => Some(("cluster.enableCloudMonitoring", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["bearer-token", "cluster", "cluster-api-version", "container-ipv4-cidr", "creation-timestamp", "description", "enable-cloud-logging", "endpoint", "machine-type", "master-auth", "name", "network", "node-config", "node-routing-prefix-size", "num-nodes", "password", "self-link", "services-ipv4-cidr", "source-image", "status", "status-message", "user", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bearer-token", "client-certificate", "client-key", "cluster", "cluster-api-version", "cluster-ca-certificate", "container-ipv4-cidr", "creation-timestamp", "description", "enable-cloud-logging", "enable-cloud-monitoring", "endpoint", "instance-group-urls", "machine-type", "master-auth", "name", "network", "node-config", "node-routing-prefix-size", "num-nodes", "password", "self-link", "services-ipv4-cidr", "source-image", "status", "status-message", "user", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -243,6 +250,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -294,6 +302,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -345,6 +354,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -396,6 +406,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -447,6 +458,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -498,54 +510,7 @@ impl<'n, 'a> Engine<'n, 'a> { let mut value = json::value::to_value(&output_schema); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); - Ok(()) - } - } - } - } - - fn _projects_zones_tokens_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.projects().zones_tokens_get(opt.value_of("master-project-id").unwrap_or(""), opt.value_of("zone-id").unwrap_or(""), opt.value_of("project-number").unwrap_or(""), opt.value_of("cluster-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); - 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(()) } } @@ -583,9 +548,6 @@ impl<'n, 'a> Engine<'n, 'a> { ("zones-operations-list", Some(opt)) => { call_result = self._projects_zones_operations_list(opt, dry_run, &mut err); }, - ("zones-tokens-get", Some(opt)) => { - call_result = self._projects_zones_tokens_get(opt, dry_run, &mut err); - }, _ => { err.issues.push(CLIError::MissingMethodError("projects".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -626,7 +588,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() @@ -639,7 +601,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() @@ -674,7 +636,7 @@ impl<'n, 'a> Engine<'n, 'a> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'clusters-list', 'operations-list', 'zones-clusters-create', 'zones-clusters-delete', 'zones-clusters-get', 'zones-clusters-list', 'zones-operations-get', 'zones-operations-list' and 'zones-tokens-get'", vec![ + ("projects", "methods: 'clusters-list', 'operations-list', 'zones-clusters-create', 'zones-clusters-delete', 'zones-clusters-get', 'zones-clusters-list', 'zones-operations-get' and 'zones-operations-list'", vec![ ("clusters-list", Some(r##"Lists all clusters owned by a project across all zones."##), "Details at http://byron.github.io/google-apis-rs/google_container1_beta1_cli/projects_clusters-list", @@ -726,7 +688,7 @@ fn main() { A firewall is added that allows traffic into port 443 on the master, which enables HTTPS. A firewall and a route is added for each node to allow the containers on that node to communicate with all other instances in the cluster. - Finally, a route named k8s-iproute-10-xx-0-0 is created to track that the cluster's 10.xx.0.0/16 CIDR has been assigned."##), + Finally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster."##), "Details at http://byron.github.io/google-apis-rs/google_container1_beta1_cli/projects_zones-clusters-create", vec![ (Some(r##"project-id"##), @@ -913,47 +875,6 @@ fn main() { 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)), - ]), - ("zones-tokens-get", - Some(r##"Gets a compute-rw scoped OAuth2 access token for - . Authentication is performed to ensure that the caller is a member of and that the request is coming from the expected master VM for the specified cluster. See go/gke-cross-project-auth for more details."##), - "Details at http://byron.github.io/google-apis-rs/google_container1_beta1_cli/projects_zones-tokens-get", - vec![ - (Some(r##"master-project-id"##), - None, - Some(r##"The hosted master project from which this request is coming."##), - Some(true), - Some(false)), - - (Some(r##"zone-id"##), - None, - Some(r##"The zone of the specified cluster."##), - Some(true), - Some(false)), - - (Some(r##"project-number"##), - None, - Some(r##"The project number for which the access token is being requested."##), - Some(true), - Some(false)), - - (Some(r##"cluster-name"##), - None, - Some(r##"The name of the specified cluster."##), - 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"##), @@ -966,7 +887,7 @@ fn main() { let mut app = App::new("container1-beta1") .author("Sebastian Thiel ") - .version("0.3.0+20150420") + .version("0.3.0+20150617") .about("The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_container1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/container1_beta1/Cargo.toml b/gen/container1_beta1/Cargo.toml index 81dbd39163..43c23fcf93 100644 --- a/gen/container1_beta1/Cargo.toml +++ b/gen/container1_beta1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-container1_beta1" -version = "0.1.8+20150420" +version = "0.1.8+20150617" authors = ["Sebastian Thiel "] description = "A complete library to interact with container (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/container1_beta1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/container1_beta1/README.md b/gen/container1_beta1/README.md index 0e83bc21f0..d8157ca895 100644 --- a/gen/container1_beta1/README.md +++ b/gen/container1_beta1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-container1_beta1` library allows access to all features of the *Google container* service. -This documentation was generated from *container* crate version *0.1.8+20150420*, where *20150420* is the exact revision of the *container:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *container* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *container:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *container* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/container-engine/docs/v1beta1/). @@ -14,7 +14,7 @@ Everything else about the *container* *v1_beta1* API can be found at the Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.Container.html) ... * projects - * [*clusters list*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectClusterListCall.html), [*operations list*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectOperationListCall.html), [*zones clusters create*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectZoneClusterGetCall.html), [*zones clusters list*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectZoneClusterListCall.html), [*zones operations get*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectZoneOperationGetCall.html), [*zones operations list*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectZoneOperationListCall.html) and [*zones tokens get*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectZoneTokenGetCall.html) + * [*clusters list*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectClusterListCall.html), [*operations list*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectOperationListCall.html), [*zones clusters create*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectZoneClusterGetCall.html), [*zones clusters list*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectZoneClusterListCall.html), [*zones operations get*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectZoneOperationGetCall.html) and [*zones operations list*](http://byron.github.io/google-apis-rs/google_container1_beta1/struct.ProjectZoneOperationListCall.html) diff --git a/gen/container1_beta1/src/cmn.rs b/gen/container1_beta1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/container1_beta1/src/cmn.rs +++ b/gen/container1_beta1/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/container1_beta1/src/lib.rs b/gen/container1_beta1/src/lib.rs index c16fb5d1f2..484d4c02ea 100644 --- a/gen/container1_beta1/src/lib.rs +++ b/gen/container1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *container* crate version *0.1.8+20150420*, where *20150420* is the exact revision of the *container:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *container* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *container:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *container* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/container-engine/docs/v1beta1/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Container.html) ... //! //! * projects -//! * [*clusters list*](struct.ProjectClusterListCall.html), [*operations list*](struct.ProjectOperationListCall.html), [*zones clusters create*](struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](struct.ProjectZoneClusterGetCall.html), [*zones clusters list*](struct.ProjectZoneClusterListCall.html), [*zones operations get*](struct.ProjectZoneOperationGetCall.html), [*zones operations list*](struct.ProjectZoneOperationListCall.html) and [*zones tokens get*](struct.ProjectZoneTokenGetCall.html) +//! * [*clusters list*](struct.ProjectClusterListCall.html), [*operations list*](struct.ProjectOperationListCall.html), [*zones clusters create*](struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](struct.ProjectZoneClusterGetCall.html), [*zones clusters list*](struct.ProjectZoneClusterListCall.html), [*zones operations get*](struct.ProjectZoneOperationGetCall.html) and [*zones operations list*](struct.ProjectZoneOperationListCall.html) //! //! //! diff --git a/gen/container1_beta1/src/lib.rs.in b/gen/container1_beta1/src/lib.rs.in index ac5379c5de..5cb689d083 100644 --- a/gen/container1_beta1/src/lib.rs.in +++ b/gen/container1_beta1/src/lib.rs.in @@ -208,13 +208,22 @@ impl ResponseResult for ListClustersResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MasterAuth { - /// The token used to authenticate API requests to the master. The token is be included in an HTTP Authorization Header included in all requests to the master endpoint. The format of the header is: "Authorization: Bearer ". + /// The token used to authenticate API requests to the master. The token is to be included in an HTTP Authorization Header in all requests to the master endpoint. The format of the header is: "Authorization: Bearer ". #[serde(rename="bearerToken")] pub bearer_token: Option, /// The password to use for HTTP basic authentication when accessing the Kubernetes master endpoint. Because the master endpoint is open to the internet, you should create a strong password. pub password: Option, + /// [Output only] Base64 encoded public certificate used by clients to authenticate to the cluster endpoint. + #[serde(rename="clientCertificate")] + pub client_certificate: Option, /// The username to use for HTTP basic authentication when accessing the Kubernetes master endpoint. pub user: Option, + /// [Output only] Base64 encoded private key used by clients to authenticate to the cluster endpoint. + #[serde(rename="clientKey")] + pub client_key: Option, + /// [Output only] Base64 encoded public certificate that is the root of trust for the cluster. + #[serde(rename="clusterCaCertificate")] + pub cluster_ca_certificate: Option, } impl Part for MasterAuth {} @@ -233,7 +242,7 @@ impl Part for MasterAuth {} pub struct Cluster { /// [Output only] The current status of this cluster. pub status: Option, - /// The IP addresses of the container pods in this cluster, in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one automatically chosen or specify a /14 block in 10.0.0.0/8 or 172.16.0.0/12. + /// The IP address range of the container pods in this cluster, in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one automatically chosen or specify a /14 block in 10.0.0.0/8 or 172.16.0.0/12. #[serde(rename="containerIpv4Cidr")] pub container_ipv4_cidr: Option, /// An optional description of this cluster. @@ -250,22 +259,28 @@ pub struct Cluster { /// [Output only] The time the cluster was created, in RFC3339 text format. #[serde(rename="creationTimestamp")] pub creation_timestamp: Option, + /// Whether metrics from the cluster should be made available via the Google Cloud Monitoring service. + #[serde(rename="enableCloudMonitoring")] + pub enable_cloud_monitoring: Option, + /// [Output only] The IP address of this cluster's Kubernetes master. The endpoint can be accessed from the internet at https://username:password@endpoint/. + /// + /// See the masterAuth property of this resource for username and password information. + pub endpoint: Option, /// The name of this cluster. The name must be unique within this project and zone, and can be up to 40 characters with the following restrictions: /// - Lowercase letters, numbers, and hyphens only. /// - Must start with a letter. /// - Must end with a number or a letter. pub name: Option, - /// [Output only] The IP address of this cluster's Kubernetes master. The endpoint can be accessed from the internet at https://username:password@endpoint/. - /// - /// See the masterAuth property of this resource for username and password information. - pub endpoint: Option, - /// The name of the Google Compute Engine network to which the cluster is connected. - pub network: Option, /// [Output only] The name of the Google Compute Engine zone in which the cluster resides. pub zone: Option, /// The number of nodes to create in this cluster. You must ensure that your Compute Engine resource quota is sufficient for this number of instances plus one (to include the master). You must also have available firewall and routes quota. #[serde(rename="numNodes")] pub num_nodes: Option, + /// [Output only] The resource URLs of [instance groups](/compute/docs/instance-groups/) associated with this cluster. + #[serde(rename="instanceGroupUrls")] + pub instance_group_urls: Option>, + /// The name of the Google Compute Engine network to which the cluster is connected. + pub network: Option, /// The machine type and image to use for all nodes in this cluster. See the descriptions of the child properties of nodeConfig. #[serde(rename="nodeConfig")] pub node_config: Option, @@ -278,7 +293,7 @@ pub struct Cluster { /// [Output only] Additional information about the current status of this cluster, if available. #[serde(rename="statusMessage")] pub status_message: Option, - /// [Output only] The IP addresses of the Kubernetes services in this cluster, in CIDR notation (e.g. 1.2.3.4/29). Service addresses are always in the 10.0.0.0/16 range. + /// [Output only] The IP address range of the Kubernetes services in this cluster, in CIDR notation (e.g. 1.2.3.4/29). Service addresses are typically put in the last /16 from the container CIDR. #[serde(rename="servicesIpv4Cidr")] pub services_ipv4_cidr: Option, } @@ -286,28 +301,6 @@ pub struct Cluster { impl ResponseResult for Cluster {} -/// 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*). -/// -/// * [zones tokens get projects](struct.ProjectZoneTokenGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Token { - /// The expiration time of the token in seconds since the unix epoch. - #[serde(rename="expiryTimeSeconds")] - pub expiry_time_seconds: Option, - /// The OAuth2 access token - #[serde(rename="accessToken")] - pub access_token: Option, -} - -impl ResponseResult for Token {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -364,7 +357,7 @@ impl Part for ServiceAccount {} pub struct Operation { /// The current status of the operation. pub status: Option, - /// The server-assigned ID for this operation. If the operation is fulfilled upfront, it may not have a resource name. + /// The server-assigned ID for the operation. pub name: Option, /// The name of the Google Compute Engine zone in which the operation is taking place. pub zone: Option, @@ -451,7 +444,7 @@ impl RequestValue for CreateClusterRequest {} /// ::default(), None); /// let mut hub = Container::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `clusters_list(...)`, `operations_list(...)`, `zones_clusters_create(...)`, `zones_clusters_delete(...)`, `zones_clusters_get(...)`, `zones_clusters_list(...)`, `zones_operations_get(...)`, `zones_operations_list(...)` and `zones_tokens_get(...)` +/// // like `clusters_list(...)`, `operations_list(...)`, `zones_clusters_create(...)`, `zones_clusters_delete(...)`, `zones_clusters_get(...)`, `zones_clusters_list(...)`, `zones_operations_get(...)` and `zones_operations_list(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -504,29 +497,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Gets a compute-rw scoped OAuth2 access token for - /// . Authentication is performed to ensure that the caller is a member of and that the request is coming from the expected master VM for the specified cluster. See go/gke-cross-project-auth for more details. - /// - /// # Arguments - /// - /// * `masterProjectId` - The hosted master project from which this request is coming. - /// * `zoneId` - The zone of the specified cluster. - /// * `projectNumber` - The project number for which the access token is being requested. - /// * `clusterName` - The name of the specified cluster. - pub fn zones_tokens_get(&self, master_project_id: &str, zone_id: &str, project_number: &str, cluster_name: &str) -> ProjectZoneTokenGetCall<'a, C, A> { - ProjectZoneTokenGetCall { - hub: self.hub, - _master_project_id: master_project_id.to_string(), - _zone_id: zone_id.to_string(), - _project_number: project_number.to_string(), - _cluster_name: cluster_name.to_string(), - _delegate: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes the cluster, including the Kubernetes master and all worker nodes. @@ -634,7 +604,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// A firewall is added that allows traffic into port 443 on the master, which enables HTTPS. A firewall and a route is added for each node to allow the containers on that node to communicate with all other instances in the cluster. /// - /// Finally, a route named k8s-iproute-10-xx-0-0 is created to track that the cluster's 10.xx.0.0/16 CIDR has been assigned. + /// Finally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster. /// /// # Arguments /// @@ -1158,256 +1128,6 @@ impl<'a, C, A> ProjectOperationListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Container::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.projects().zones_tokens_get("masterProjectId", "zoneId", "projectNumber", "clusterName") -/// .doit(); -/// # } -/// ``` -pub struct ProjectZoneTokenGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Container, - _master_project_id: String, - _zone_id: String, - _project_number: String, - _cluster_name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, -} - -impl<'a, C, A> CallBuilder for ProjectZoneTokenGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectZoneTokenGetCall<'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, Token)> { - 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: "container.projects.zones.tokens.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("masterProjectId", self._master_project_id.to_string())); - params.push(("zoneId", self._zone_id.to_string())); - params.push(("projectNumber", self._project_number.to_string())); - params.push(("clusterName", self._cluster_name.to_string())); - for &field in ["alt", "masterProjectId", "zoneId", "projectNumber", "clusterName"].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://www.googleapis.com/container/v1beta1/projects/{masterProjectId}/zones/{zoneId}/tokens/{projectNumber}/{clusterName}".to_string(); - - let mut key = self.hub.auth.borrow_mut().api_key(); - if key.is_none() { - key = dlg.api_key(); - } - match key { - Some(value) => params.push(("key", value)), - None => { - dlg.finished(false); - return Err(Error::MissingAPIKey) - } - } - - for &(find_this, param_name) in [("{masterProjectId}", "masterProjectId"), ("{zoneId}", "zoneId"), ("{projectNumber}", "projectNumber"), ("{clusterName}", "clusterName")].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(4); - for param_name in ["clusterName", "projectNumber", "zoneId", "masterProjectId"].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 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())); - - 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 hosted master project from which this request is coming. - /// - /// Sets the *master project 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 master_project_id(mut self, new_value: &str) -> ProjectZoneTokenGetCall<'a, C, A> { - self._master_project_id = new_value.to_string(); - self - } - /// The zone of the specified cluster. - /// - /// Sets the *zone 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 zone_id(mut self, new_value: &str) -> ProjectZoneTokenGetCall<'a, C, A> { - self._zone_id = new_value.to_string(); - self - } - /// The project number for which the access token is being requested. - /// - /// Sets the *project number* 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 project_number(mut self, new_value: &str) -> ProjectZoneTokenGetCall<'a, C, A> { - self._project_number = new_value.to_string(); - self - } - /// The name of the specified cluster. - /// - /// Sets the *cluster 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 cluster_name(mut self, new_value: &str) -> ProjectZoneTokenGetCall<'a, C, A> { - self._cluster_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) -> ProjectZoneTokenGetCall<'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 - /// - /// * *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. Overrides userIp if both are provided. - /// * *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. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectZoneTokenGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - -} - - /// Deletes the cluster, including the Kubernetes master and all worker nodes. /// /// Firewalls and routes that were configured at cluster creation are also deleted. @@ -2668,7 +2388,7 @@ impl<'a, C, A> ProjectZoneClusterListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Shopping Content (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/content2-cli" @@ -17,8 +17,8 @@ keywords = ["content", "google", "cli"] name = "content2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/content2-cli/README.md b/gen/content2-cli/README.md index 0f1aa94a63..28729aa4e4 100644 --- a/gen/content2-cli/README.md +++ b/gen/content2-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Shopping Content* API at revision *20150421*. The CLI is at version *0.3.0*. +This documentation was generated from the *Shopping Content* API at revision *20150528*. The CLI is at version *0.3.0*. ```bash content2 [options] diff --git a/gen/content2-cli/mkdocs.yml b/gen/content2-cli/mkdocs.yml index 02b1148c8b..d8ea63063c 100644 --- a/gen/content2-cli/mkdocs.yml +++ b/gen/content2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Shopping Content v0.3.0+20150421 +site_name: Shopping Content v0.3.0+20150528 site_url: http://byron.github.io/google-apis-rs/google-content2-cli site_description: Write integrating applications with bcore diff --git a/gen/content2-cli/src/main.rs b/gen/content2-cli/src/main.rs index a5ab963335..19ab212592 100644 --- a/gen/content2-cli/src/main.rs +++ b/gen/content2-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -172,6 +173,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -267,6 +269,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -357,6 +360,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -415,6 +419,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -505,6 +510,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -595,6 +601,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -682,6 +689,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -733,6 +741,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -791,6 +800,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -880,6 +890,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -969,6 +980,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1052,6 +1064,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1103,6 +1116,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1161,6 +1175,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1248,6 +1263,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1299,6 +1315,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1357,6 +1374,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1446,6 +1464,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1535,6 +1554,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1618,6 +1638,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1713,6 +1734,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1815,6 +1837,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1873,6 +1896,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1975,6 +1999,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2077,6 +2102,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2160,6 +2186,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2211,6 +2238,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2269,6 +2297,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2352,6 +2381,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2442,6 +2472,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2529,6 +2560,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2628,6 +2660,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2789,6 +2822,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2847,6 +2881,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2930,6 +2965,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2981,6 +3017,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3039,6 +3076,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3279,7 +3317,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() @@ -3292,7 +3330,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() @@ -4434,7 +4472,7 @@ fn main() { let mut app = App::new("content2") .author("Sebastian Thiel ") - .version("0.3.0+20150421") + .version("0.3.0+20150528") .about("Manage product items, inventory, and Merchant Center accounts for Google Shopping.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_content2_cli") .arg(Arg::with_name("url") diff --git a/gen/content2/Cargo.toml b/gen/content2/Cargo.toml index 67e8218595..eaccddeaa4 100644 --- a/gen/content2/Cargo.toml +++ b/gen/content2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-content2" -version = "0.1.8+20150421" +version = "0.1.8+20150528" authors = ["Sebastian Thiel "] description = "A complete library to interact with Shopping Content (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/content2" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/content2/README.md b/gen/content2/README.md index 07055d5f93..8ed1b41ce4 100644 --- a/gen/content2/README.md +++ b/gen/content2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-content2` library allows access to all features of the *Google Shopping Content* service. -This documentation was generated from *Shopping Content* crate version *0.1.8+20150421*, where *20150421* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Shopping Content* crate version *0.1.8+20150528*, where *20150528* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *Shopping Content* *v2* API can be found at the [official documentation site](https://developers.google.com/shopping-content/v2/). diff --git a/gen/content2/src/cmn.rs b/gen/content2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/content2/src/cmn.rs +++ b/gen/content2/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/content2/src/lib.rs b/gen/content2/src/lib.rs index babb12fa89..1e8aef0b87 100644 --- a/gen/content2/src/lib.rs +++ b/gen/content2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Shopping Content* crate version *0.1.8+20150421*, where *20150421* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Shopping Content* crate version *0.1.8+20150528*, where *20150528* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *Shopping Content* *v2* API can be found at the //! [official documentation site](https://developers.google.com/shopping-content/v2/). diff --git a/gen/coordinate1-cli/Cargo.toml b/gen/coordinate1-cli/Cargo.toml index c694b3e00c..5e06df00a0 100644 --- a/gen/coordinate1-cli/Cargo.toml +++ b/gen/coordinate1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["coordinate", "google", "cli"] name = "coordinate1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/coordinate1-cli/src/main.rs b/gen/coordinate1-cli/src/main.rs index ab25181938..2d918ef51f 100644 --- a/gen/coordinate1-cli/src/main.rs +++ b/gen/coordinate1-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -140,6 +141,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -255,6 +257,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -316,6 +319,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -444,6 +448,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -572,6 +577,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -630,6 +636,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -681,6 +688,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -782,6 +790,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -883,6 +892,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -944,6 +954,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -995,6 +1006,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1124,7 +1136,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() @@ -1137,7 +1149,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() diff --git a/gen/coordinate1/Cargo.toml b/gen/coordinate1/Cargo.toml index 7d5537de43..ef23b4680c 100644 --- a/gen/coordinate1/Cargo.toml +++ b/gen/coordinate1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/coordinate1/src/cmn.rs b/gen/coordinate1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/coordinate1/src/cmn.rs +++ b/gen/coordinate1/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/customsearch1-cli/Cargo.toml b/gen/customsearch1-cli/Cargo.toml index 7c3a9eabd9..d2512b2542 100644 --- a/gen/customsearch1-cli/Cargo.toml +++ b/gen/customsearch1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["customsearch", "google", "cli"] name = "customsearch1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/customsearch1-cli/src/main.rs b/gen/customsearch1-cli/src/main.rs index b6146dc43a..0f1eafd1f6 100644 --- a/gen/customsearch1-cli/src/main.rs +++ b/gen/customsearch1-cli/src/main.rs @@ -180,6 +180,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -236,7 +237,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() @@ -249,7 +250,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() diff --git a/gen/customsearch1/Cargo.toml b/gen/customsearch1/Cargo.toml index ef477a8574..c8d2086f3f 100644 --- a/gen/customsearch1/Cargo.toml +++ b/gen/customsearch1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/customsearch1/src/cmn.rs b/gen/customsearch1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/customsearch1/src/cmn.rs +++ b/gen/customsearch1/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/datastore1_beta2-cli/Cargo.toml b/gen/datastore1_beta2-cli/Cargo.toml index 494c495b7a..e486c58d1d 100644 --- a/gen/datastore1_beta2-cli/Cargo.toml +++ b/gen/datastore1_beta2-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["datastore", "google", "cli"] name = "datastore1-beta2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/datastore1_beta2-cli/src/main.rs b/gen/datastore1_beta2-cli/src/main.rs index dad866dc5c..dabcc91db3 100644 --- a/gen/datastore1_beta2-cli/src/main.rs +++ b/gen/datastore1_beta2-cli/src/main.rs @@ -121,6 +121,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -205,6 +206,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -292,6 +294,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -377,6 +380,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -461,6 +465,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -570,6 +575,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -641,7 +647,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() @@ -654,7 +660,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() diff --git a/gen/datastore1_beta2/Cargo.toml b/gen/datastore1_beta2/Cargo.toml index 0b90fdf9a0..8dd581fadb 100644 --- a/gen/datastore1_beta2/Cargo.toml +++ b/gen/datastore1_beta2/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/datastore1_beta2/src/cmn.rs b/gen/datastore1_beta2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/datastore1_beta2/src/cmn.rs +++ b/gen/datastore1_beta2/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/deploymentmanager2_beta2-cli/Cargo.toml b/gen/deploymentmanager2_beta2-cli/Cargo.toml new file mode 100644 index 0000000000..6aa2297f89 --- /dev/null +++ b/gen/deploymentmanager2_beta2-cli/Cargo.toml @@ -0,0 +1,34 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-deploymentmanager2_beta2-cli" +version = "0.3.0+20150616" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Deployment Manager (protocol v2beta2)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2_beta2-cli" +homepage = "https://developers.google.com/deployment-manager/" +documentation = "http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli" +license = "MIT" +keywords = ["deploymentmanager", "google", "cli"] + +[[bin]] +name = "deploymentmanager2-beta2" + +[dependencies] +hyper = ">= 0.6.0" +mime = "0.0.12" +serde = ">= 0.4.1" +yup-oauth2 = "*" +strsim = "*" +yup-hyper-mock = ">=1.0.0" +clap = ">= 0.9.1" + +[build-dependencies] +syntex = { version = "*" } +serde_codegen = { version = "*" } + + +[dependencies.google-deploymentmanager2_beta2] +path = "../deploymentmanager2_beta2" diff --git a/gen/deploymentmanager2_beta2-cli/LICENSE.md b/gen/deploymentmanager2_beta2-cli/LICENSE.md new file mode 100644 index 0000000000..ae22e6ec52 --- /dev/null +++ b/gen/deploymentmanager2_beta2-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015` `Sebastian Thiel` + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the “Software”), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/gen/deploymentmanager2_beta2-cli/README.md b/gen/deploymentmanager2_beta2-cli/README.md new file mode 100644 index 0000000000..002894608f --- /dev/null +++ b/gen/deploymentmanager2_beta2-cli/README.md @@ -0,0 +1,129 @@ + +The `deploymentmanager2-beta2` command-line interface *(CLI)* allows to use most features of the *Google Deployment Manager* service from the comfort of your terminal. + +By default all output is printed to standard out, but flags can be set to direct it into a file independent of your shell's +capabilities. Errors will be printed to standard error, and cause the program's exit code to be non-zero. + +If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. + +Everything else about the *Deployment Manager* API can be found at the +[official documentation site](https://developers.google.com/deployment-manager/). + +# Downloads + +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/deploymentmanager2-beta2.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/deploymentmanager2-beta2.tar.gz) + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2_beta2-cli). + +# Usage + +This documentation was generated from the *Deployment Manager* API at revision *20150616*. The CLI is at version *0.3.0*. + +```bash +deploymentmanager2-beta2 [options] + deployments + delete [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + manifests + get [-p ]... [-o ] + list [-p ]... [-o ] + operations + get [-p ]... [-o ] + list [-p ]... [-o ] + resources + get [-p ]... [-o ] + list [-p ]... [-o ] + types + list [-p ]... [-o ] + deploymentmanager2-beta2 --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. + [default: ~/.google-service-cli] + --debug + Output all server communication to standard error. `tx` and `rx` are placed + into the same stream. + --debug-auth + Output all communication related to authentication to standard error. `tx` + and `rx` are placed into the same stream. + +``` + +# Configuration + +The program will store all persistent data in the `~/.google-service-cli` directory in *JSON* files prefixed with `deploymentmanager2-beta2-`. You can change the directory used to store configuration with the `--config-dir` flag on a per-invocation basis. + +More information about the various kinds of persistent data are given in the following paragraphs. + +# Authentication + +Most APIs require a user to authenticate any request. If this is the case, the [scope][scopes] determines the +set of permissions granted. The granularity of these is usually no more than *read-only* or *full-access*. + +If not set, the system will automatically select the smallest feasible scope, e.g. when invoking a +method that is read-only, it will ask only for a read-only scope. +You may use the `--scope` flag to specify a scope directly. +All applicable scopes are documented in the respective method's CLI documentation. + +The first time a scope is used, the user is asked for permission. Follow the instructions given +by the CLI to grant permissions, or to decline. + +If a scope was authenticated by the user, the respective information will be stored as *JSON* in the configuration +directory, e.g. `~/.google-service-cli/deploymentmanager2-beta2-token-.json`. No manual management of these tokens +is necessary. + +To revoke granted authentication, please refer to the [official documentation][revoke-access]. + +# Application Secrets + +In order to allow any application to use Google services, it will need to be registered using the +[Google Developer Console][google-dev-console]. APIs the application may use are then enabled for it +one by one. Most APIs can be used for free and have a daily quota. + +To allow more comfortable usage of the CLI without forcing anyone to register an own application, the CLI +comes with a default application secret that is configured accordingly. This also means that heavy usage +all around the world may deplete the daily quota. + +You can workaround this limitation by putting your own secrets file at this location: +`~/.google-service-cli/deploymentmanager2-beta2-secret.json`, assuming that the required *deploymentmanager* API +was enabled for it. Such a secret file can be downloaded in the *Google Developer Console* at +*APIs & auth -> Credentials -> Download JSON* and used as is. + +Learn more about how to setup Google projects and enable APIs using the [official documentation][google-project-new]. + + +# Debugging + +Even though the CLI does its best to provide usable error messages, sometimes it might be desirable to know +what exactly led to a particular issue. This is done by allowing all client-server communication to be +output to standard error *as-is*. + +The `--debug` flag will print all client-server communication to standard error, whereas the `--debug-auth` flag +will cause all communication related to authentication to standard error. +If the `--debug` flag is set, error-results will be debug-printed, possibly yielding more information about the +issue at hand. + +You may consider redirecting standard error into a file for ease of use, e.g. `deploymentmanager2-beta2 --debug [options] 2>debug.txt`. + + +[scopes]: https://developers.google.com/+/api/oauth#scopes +[revoke-access]: http://webapps.stackexchange.com/a/30849 +[google-dev-console]: https://console.developers.google.com/ +[google-project-new]: https://developers.google.com/console/help/new/ \ No newline at end of file diff --git a/gen/deploymentmanager2_beta2-cli/mkdocs.yml b/gen/deploymentmanager2_beta2-cli/mkdocs.yml new file mode 100644 index 0000000000..f1b5969fd2 --- /dev/null +++ b/gen/deploymentmanager2_beta2-cli/mkdocs.yml @@ -0,0 +1,29 @@ +site_name: Deployment Manager v0.3.0+20150616 +site_url: http://byron.github.io/google-apis-rs/google-deploymentmanager2_beta2-cli +site_description: Write integrating applications with bcore + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2_beta2-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['deployments_delete.md', 'Deployments', 'Delete'] +- ['deployments_get.md', 'Deployments', 'Get'] +- ['deployments_insert.md', 'Deployments', 'Insert'] +- ['deployments_list.md', 'Deployments', 'List'] +- ['deployments_patch.md', 'Deployments', 'Patch'] +- ['deployments_update.md', 'Deployments', 'Update'] +- ['manifests_get.md', 'Manifests', 'Get'] +- ['manifests_list.md', 'Manifests', 'List'] +- ['operations_get.md', 'Operations', 'Get'] +- ['operations_list.md', 'Operations', 'List'] +- ['resources_get.md', 'Resources', 'Get'] +- ['resources_list.md', 'Resources', 'List'] +- ['types_list.md', 'Types', 'List'] + +theme: readthedocs + +copyright: Copyright © 2015, `Sebastian Thiel` + diff --git a/gen/deploymentmanager2_beta2-cli/src/cmn.rs b/gen/deploymentmanager2_beta2-cli/src/cmn.rs new file mode 100644 index 0000000000..56051cab08 --- /dev/null +++ b/gen/deploymentmanager2_beta2-cli/src/cmn.rs @@ -0,0 +1,718 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde::json; +use serde::json::value::Value; +use mime::Mime; +use clap::{App, SubCommand}; +use strsim; + +use std::fs; +use std::env; +use std::io; +use std::fmt; +use std::path::{Path, PathBuf}; +use std::str::FromStr; +use std::string::ToString; +use std::io::{Write, Read, stdout}; + +use std::default::Default; + +const FIELD_SEP: char = '.'; + + +pub enum ComplexType { + Pod, + Vec, + Map, +} + + // Null, + // Bool(bool), + // I64(i64), + // U64(u64), + // F64(f64), + // String(String), + +pub enum JsonType { + Boolean, + Int, + Uint, + Float, + String, +} + +pub struct JsonTypeInfo { + pub jtype: JsonType, + pub ctype: ComplexType, +} + +// Based on @erickt user comment. Thanks for the idea ! +// Remove all keys whose values are null from given value (changed in place) +pub fn remove_json_null_values(value: &mut Value) { + match *value { + Value::Object(ref mut map) => { + let mut for_removal = Vec::new(); + + for (key, mut value) in map.iter_mut() { + if value.is_null() { + for_removal.push(key.clone()); + } else { + remove_json_null_values(&mut value); + } + } + + for key in &for_removal { + map.remove(key); + } + } + _ => {} + } +} + +fn did_you_mean<'a>(v: &str, possible_values: &[&'a str]) -> Option<&'a str> { + + let mut candidate: Option<(f64, &str)> = None; + for pv in possible_values { + let confidence = strsim::jaro_winkler(v, pv); + if confidence > 0.8 && (candidate.is_none() || (candidate.as_ref().unwrap().0 < confidence)) { + candidate = Some((confidence, pv)); + } + } + match candidate { + None => None, + Some((_, candidate)) => Some(candidate), + } +} + +pub enum CallType { + Upload(UploadProtocol), + Standard, +} + +arg_enum!{ + pub enum UploadProtocol { + Simple, + Resumable + } +} + +impl AsRef for UploadProtocol { + fn as_ref(&self) -> &str { + match *self { + UploadProtocol::Simple => "simple", + UploadProtocol::Resumable => "resumable" + } + } +} + +impl AsRef for CallType { + fn as_ref(&self) -> &str { + match *self { + CallType::Upload(ref proto) => proto.as_ref(), + CallType::Standard => "standard-request" + } + } +} + +#[derive(Clone, Default)] +pub struct FieldCursor(Vec); + +impl ToString for FieldCursor { + fn to_string(&self) -> String { + self.0.connect(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +impl FieldCursor { + pub fn set(&mut self, value: &str) -> Result<(), CLIError> { + if value.len() == 0 { + return Err(CLIError::Field(FieldError::Empty)) + } + + let mut first_is_field_sep = false; + let mut char_count: usize = 0; + let mut last_c = FIELD_SEP; + let mut num_conscutive_field_seps = 0; + + let mut field = String::new(); + let mut fields = self.0.clone(); + + let push_field = |fs: &mut Vec, f: &mut String| { + if f.len() > 0 { + fs.push(f.clone()); + f.truncate(0); + } + }; + + for (cid, c) in value.chars().enumerate() { + char_count += 1; + + if c == FIELD_SEP { + if cid == 0 { + first_is_field_sep = true; + } + num_conscutive_field_seps += 1; + if cid > 0 && last_c == FIELD_SEP { + if fields.pop().is_none() { + return Err(CLIError::Field(FieldError::PopOnEmpty(value.to_string()))) + } + } else { + push_field(&mut fields, &mut field); + } + } else { + num_conscutive_field_seps = 0; + if cid == 1 { + if first_is_field_sep { + fields.truncate(0); + } + } + field.push(c); + } + + last_c = c; + } + + push_field(&mut fields, &mut field); + + if char_count == 1 && first_is_field_sep { + fields.truncate(0); + } + if char_count > 1 && num_conscutive_field_seps == 1 { + return Err(CLIError::Field(FieldError::TrailingFieldSep(value.to_string()))) + } + + self.0 = fields; + Ok(()) + } + + pub fn did_you_mean(value: &str, possible_values: &[&str]) -> Option { + if value.len() == 0 { + return None + } + + let mut last_c = FIELD_SEP; + + let mut field = String::new(); + let mut output = String::new(); + + let push_field = |fs: &mut String, f: &mut String| { + if f.len() > 0 { + fs.push_str( + match did_you_mean(&f, possible_values) { + Some(candidate) => candidate, + None => &f, + }); + f.truncate(0); + } + }; + + for (cid, c) in value.chars().enumerate() { + if c == FIELD_SEP { + if last_c != FIELD_SEP { + push_field(&mut output, &mut field); + } + output.push(c); + } else { + field.push(c); + } + + last_c = c; + } + + push_field(&mut output, &mut field); + + if &output == value { + None + } else { + Some(output) + } + } + + pub fn set_json_value(&self, mut object: &mut Value, + value: &str, type_info: JsonTypeInfo, + err: &mut InvalidOptionsError, + orig_cursor: &FieldCursor) { + assert!(self.0.len() > 0); + + for field in &self.0[..self.0.len()-1] { + let tmp = object; + object = + match *tmp { + Value::Object(ref mut mapping) => { + mapping.entry(field.to_owned()).or_insert( + Value::Object(Default::default()) + ) + }, + _ => panic!("We don't expect non-object Values here ...") + }; + } + + match *object { + Value::Object(ref mut mapping) => { + let field = &self.0[self.0.len()-1]; + let to_jval = + |value: &str, jtype: JsonType, err: &mut InvalidOptionsError| + -> Value { + match jtype { + JsonType::Boolean => + Value::Bool(arg_from_str(value, err, &field, "boolean")), + JsonType::Int => + Value::I64(arg_from_str(value, err, &field, "int")), + JsonType::Uint => + Value::U64(arg_from_str(value, err, &field, "uint")), + JsonType::Float => + Value::F64(arg_from_str(value, err, &field, "float")), + JsonType::String => + Value::String(value.to_owned()), + } + }; + + match type_info.ctype { + ComplexType::Pod => { + if mapping.insert(field.to_owned(), to_jval(value, type_info.jtype, err)).is_some() { + err.issues.push(CLIError::Field(FieldError::Duplicate(orig_cursor.to_string()))); + } + }, + ComplexType::Vec => { + match *mapping.entry(field.to_owned()) + .or_insert(Value::Array(Default::default())) { + Value::Array(ref mut values) => values.push(to_jval(value, type_info.jtype, err)), + _ => unreachable!() + } + }, + ComplexType::Map => { + let (key, value) = parse_kv_arg(value, err, true); + let jval = to_jval(value.unwrap_or(""), type_info.jtype, err); + + match *mapping.entry(field.to_owned()) + .or_insert(Value::Object(Default::default())) { + Value::Object(ref mut value_map) => { + if value_map.insert(key.to_owned(), jval).is_some() { + err.issues.push(CLIError::Field(FieldError::Duplicate(orig_cursor.to_string()))); + } + } + _ => unreachable!() + } + } + } + }, + _ => unreachable!() + } + } + + pub fn num_fields(&self) -> usize { + self.0.len() + } +} + +pub fn parse_kv_arg<'a>(kv: &'a str, err: &mut InvalidOptionsError, for_hashmap: bool) + -> (&'a str, Option<&'a str>) { + let mut add_err = || err.issues.push(CLIError::InvalidKeyValueSyntax(kv.to_string(),for_hashmap)); + match kv.find('=') { + None => { + add_err(); + return (kv, None) + }, + Some(pos) => { + let key = &kv[..pos]; + if kv.len() <= pos + 1 { + add_err(); + return (key, Some("")) + } + (key, Some(&kv[pos+1..])) + } + } +} + +pub fn calltype_from_str(name: &str, valid_protocols: Vec, err: &mut InvalidOptionsError) -> CallType { + CallType::Upload( + match UploadProtocol::from_str(name) { + Ok(up) => up, + Err(msg) => { + err.issues.push(CLIError::InvalidUploadProtocol(name.to_string(), valid_protocols)); + UploadProtocol::Simple + } + }) +} + +pub fn input_file_from_opts(file_path: &str, err: &mut InvalidOptionsError) -> Option { + match fs::File::open(file_path) { + Ok(f) => Some(f), + Err(io_err) => { + err.issues.push(CLIError::Input(InputError::IOError((file_path.to_string(), io_err)))); + None + } + } +} + +pub fn input_mime_from_opts(mime: &str, err: &mut InvalidOptionsError) -> Option { + match mime.parse() { + Ok(m) => Some(m), + Err(_) => { + err.issues.push(CLIError::Input(InputError::Mime(mime.to_string()))); + None + } + } +} + +pub fn writer_from_opts(arg: Option<&str>) -> Result, io::Error> { + let f = arg.unwrap_or("-"); + match f { + "-" => Ok(Box::new(stdout())), + _ => match fs::OpenOptions::new().create(true).write(true).open(f) { + Ok(f) => Ok(Box::new(f)), + Err(io_err) => Err(io_err), + } + } +} + + +pub fn arg_from_str<'a, T>(arg: &str, err: &mut InvalidOptionsError, + arg_name: &'a str, + arg_type: &'a str) -> T + where T: FromStr + Default, + ::Err: fmt::Display { + match FromStr::from_str(arg) { + Err(perr) => { + err.issues.push( + CLIError::ParseError(arg_name.to_owned(), arg_type.to_owned(), arg.to_string(), format!("{}", perr)) + ); + Default::default() + }, + Ok(v) => v, + } +} + +pub struct JsonTokenStorage { + pub program_name: &'static str, + pub db_dir: String, +} + +impl JsonTokenStorage { + fn path(&self, scope_hash: u64) -> PathBuf { + Path::new(&self.db_dir).join(&format!("{}-token-{}.json", self.program_name, scope_hash)) + } +} + +impl TokenStorage for JsonTokenStorage { + type Error = json::Error; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, scope_hash: u64, _: &Vec<&str>, token: Option) -> Result<(), json::Error> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => + match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(json::Error::IoError(err)) + }, + Ok(_) => Ok(()), + } + } + Some(token) => { + match fs::OpenOptions::new().create(true).write(true).open(&self.path(scope_hash)) { + Ok(mut f) => { + match json::to_writer_pretty(&mut f, &token) { + Ok(_) => Ok(()), + Err(io_err) => Err(json::Error::IoError(io_err)), + } + }, + Err(io_err) => Err(json::Error::IoError(io_err)) + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, json::Error> { + match fs::File::open(&self.path(scope_hash)) { + Ok(mut f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(err), + } + }, + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(json::Error::IoError(io_err)) + } + } + } + } +} + + +#[derive(Debug)] +pub enum ApplicationSecretError { + DecoderError((String, json::Error)), + FormatError(String), +} + +impl fmt::Display for ApplicationSecretError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + ApplicationSecretError::DecoderError((ref path, ref err)) + => writeln!(f, "Could not decode file at '{}' with error: {}.", + path, err), + ApplicationSecretError::FormatError(ref path) + => writeln!(f, "'installed' field is unset in secret file at '{}'.", + path), + } + } +} + +#[derive(Debug)] +pub enum ConfigurationError { + DirectoryCreationFailed((String, io::Error)), + DirectoryUnset, + HomeExpansionFailed(String), + Secret(ApplicationSecretError), + IOError((String, io::Error)), +} + +impl fmt::Display for ConfigurationError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + ConfigurationError::DirectoryCreationFailed((ref dir, ref err)) + => writeln!(f, "Directory '{}' could not be created with error: {}.", dir, err), + ConfigurationError::DirectoryUnset + => writeln!(f, "--config-dir was unset or empty."), + ConfigurationError::HomeExpansionFailed(ref dir) + => writeln!(f, "Couldn't find HOME directory of current user, failed to expand '{}'.", dir), + ConfigurationError::Secret(ref err) + => writeln!(f, "Secret -> {}", err), + ConfigurationError::IOError((ref path, ref err)) + => writeln!(f, "IO operation failed on path '{}' with error: {}.", path, err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + IOError((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::IOError((ref file_path, ref io_err)) + => writeln!(f, "Failed to open '{}' for reading with error: {}.", file_path, io_err), + InputError::Mime(ref mime) + => writeln!(f, "'{}' is not a known mime-type.", mime), + } + } +} + +#[derive(Debug)] +pub enum FieldError { + PopOnEmpty(String), + TrailingFieldSep(String), + Unknown(String, Option, Option), + Duplicate(String), + Empty, +} + + +impl fmt::Display for FieldError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + FieldError::PopOnEmpty(ref field) + => writeln!(f, "'{}': Cannot move up on empty field cursor.", field), + FieldError::TrailingFieldSep(ref field) + => writeln!(f, "'{}': Single field separator may not be last character.", field), + FieldError::Unknown(ref field, ref suggestion, ref value) => { + let suffix = + match *suggestion { + Some(ref s) => { + let kv = + match *value { + Some(ref v) => format!("{}={}", s, v), + None => s.clone(), + }; + format!(" Did you mean '{}' ?", kv) + }, + None => String::new(), + }; + writeln!(f, "Field '{}' does not exist.{}", field, suffix) + }, + FieldError::Duplicate(ref cursor) + => writeln!(f, "Value at '{}' was already set", cursor), + FieldError::Empty + => writeln!(f, "Field names must not be empty."), + } + } +} + + +#[derive(Debug)] +pub enum CLIError { + Configuration(ConfigurationError), + ParseError(String, String, String, String), + UnknownParameter(String, Vec<&'static str>), + InvalidUploadProtocol(String, Vec), + InvalidKeyValueSyntax(String, bool), + Input(InputError), + Field(FieldError), + MissingCommandError, + MissingMethodError(String), +} + +impl fmt::Display for CLIError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + CLIError::Configuration(ref err) => write!(f, "Configuration -> {}", err), + CLIError::Input(ref err) => write!(f, "Input -> {}", err), + CLIError::Field(ref err) => write!(f, "Field -> {}", err), + CLIError::InvalidUploadProtocol(ref proto_name, ref valid_names) + => writeln!(f, "'{}' is not a valid upload protocol. Choose from one of {}.", proto_name, valid_names.connect(", ")), + CLIError::ParseError(ref arg_name, ref type_name, ref value, ref err_desc) + => writeln!(f, "Failed to parse argument '{}' with value '{}' as {} with error: {}.", + arg_name, value, type_name, err_desc), + CLIError::UnknownParameter(ref param_name, ref possible_values) => { + let mut suffix = + match did_you_mean(param_name, &possible_values) { + Some(v) => format!(" Did you mean '{}' ?", v), + None => String::new(), + }; + write!(f, "Parameter '{}' is unknown.{}\n", param_name, suffix) + }, + CLIError::InvalidKeyValueSyntax(ref kv, is_hashmap) => { + let hashmap_info = if is_hashmap { "hashmap " } else { "" }; + writeln!(f, "'{}' does not match {}pattern =.", kv, hashmap_info) + }, + CLIError::MissingCommandError => writeln!(f, "Please specify the main sub-command."), + CLIError::MissingMethodError(ref cmd) => writeln!(f, "Please specify the method to call on the '{}' command.", cmd), + } + } +} + +#[derive(Debug)] +pub struct InvalidOptionsError { + pub issues: Vec, + pub exit_code: i32, +} + +impl fmt::Display for InvalidOptionsError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + for issue in &self.issues { + try!(issue.fmt(f)); + } + Ok(()) + } +} + +impl InvalidOptionsError { + pub fn single(err: CLIError, exit_code: i32) -> InvalidOptionsError { + InvalidOptionsError { + issues: vec![err], + exit_code: exit_code, + } + } + + pub fn new() -> InvalidOptionsError { + InvalidOptionsError { + issues: Vec::new(), + exit_code: 1, + } + } +} + +pub fn assure_config_dir_exists(dir: &str) -> Result { + let trdir = dir.trim(); + if trdir.len() == 0 { + return Err(CLIError::Configuration(ConfigurationError::DirectoryUnset)) + } + + let expanded_config_dir = + if trdir.as_bytes()[0] == b'~' { + match env::var("HOME").ok().or(env::var("UserProfile").ok()) { + None => return Err(CLIError::Configuration(ConfigurationError::HomeExpansionFailed(trdir.to_string()))), + Some(mut user) => { + user.push_str(&trdir[1..]); + user + } + } + } else { + trdir.to_string() + }; + + if let Err(err) = fs::create_dir(&expanded_config_dir) { + if err.kind() != io::ErrorKind::AlreadyExists { + return Err(CLIError::Configuration( + ConfigurationError::DirectoryCreationFailed((expanded_config_dir, err)))) + } + } + + Ok(expanded_config_dir) +} + +pub fn application_secret_from_directory(dir: &str, + secret_basename: &str, + json_console_secret: &str) + -> Result { + let secret_path = Path::new(dir).join(secret_basename); + let secret_str = || secret_path.as_path().to_str().unwrap().to_string(); + let secret_io_error = |io_err: io::Error| { + Err(CLIError::Configuration(ConfigurationError::IOError( + (secret_str(), io_err) + ))) + }; + + for _ in 0..2 { + match fs::File::open(&secret_path) { + Err(mut err) => { + if err.kind() == io::ErrorKind::NotFound { + // Write our built-in one - user may adjust the written file at will + + err = match fs::OpenOptions::new().create(true).write(true).open(&secret_path) { + Err(cfe) => cfe, + Ok(mut f) => { + // Assure we convert 'ugly' json string into pretty one + let console_secret: ConsoleApplicationSecret + = json::from_str(json_console_secret).unwrap(); + match json::to_writer_pretty(&mut f, &console_secret) { + Err(io_err) => io_err, + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err) + }, + Ok(mut f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + Err(json::Error::IoError(err)) => + return secret_io_error(err), + Err(json_err) => + return Err(CLIError::Configuration( + ConfigurationError::Secret( + ApplicationSecretError::DecoderError( + (secret_str(), json_err) + )))), + Ok(console_secret) => + match console_secret.installed { + Some(secret) => return Ok(secret), + None => return Err( + CLIError::Configuration( + ConfigurationError::Secret( + ApplicationSecretError::FormatError(secret_str()) + ))) + }, + } + } + } + } + unreachable!(); +} \ No newline at end of file diff --git a/gen/deploymentmanager2_beta2-cli/src/main.rs b/gen/deploymentmanager2_beta2-cli/src/main.rs new file mode 100644 index 0000000000..6e4e4a74a9 --- /dev/null +++ b/gen/deploymentmanager2_beta2-cli/src/main.rs @@ -0,0 +1,1573 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/cli/main.rs.mako' +// DO NOT EDIT ! +#![allow(unused_variables, unused_imports, dead_code, unused_mut)] + +#[macro_use] +extern crate clap; +extern crate yup_oauth2 as oauth2; +extern crate yup_hyper_mock as mock; +extern crate serde; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_deploymentmanager2_beta2 as api; + +use std::env; +use std::io::{self, Write}; +use clap::{App, SubCommand, Arg}; + +mod cmn; + +use cmn::{InvalidOptionsError, CLIError, JsonTokenStorage, arg_from_str, writer_from_opts, parse_kv_arg, + input_file_from_opts, input_mime_from_opts, FieldCursor, FieldError, CallType, UploadProtocol, + calltype_from_str, remove_json_null_values, ComplexType, JsonType, JsonTypeInfo}; + +use std::default::Default; +use std::str::FromStr; + +use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; +use serde::json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n, 'a> { + opt: ArgMatches<'n, 'a>, + hub: api::DeploymentManager>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n, 'a> Engine<'n, 'a> { + fn _deployments_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.deployments().delete(opt.value_of("project").unwrap_or(""), opt.value_of("deployment").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 _deployments_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.deployments().get(opt.value_of("project").unwrap_or(""), opt.value_of("deployment").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 _deployments_insert(&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()[..] { + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.errors" => Some(("update.errors", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "update.manifest" => Some(("update.manifest", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manifest" => Some(("manifest", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "intent" => Some(("intent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "insert-time" => Some(("insertTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "target.config" => Some(("target.config", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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!["config", "description", "errors", "fingerprint", "id", "insert-time", "intent", "manifest", "name", "state", "target", "update", "update-time"]); + 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::Deployment = json::value::from_value(object).unwrap(); + let mut call = self.hub.deployments().insert(request, opt.value_of("project").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 _deployments_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.deployments().list(opt.value_of("project").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("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "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", "max-results"].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 _deployments_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()[..] { + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.errors" => Some(("update.errors", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "update.manifest" => Some(("update.manifest", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manifest" => Some(("manifest", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "intent" => Some(("intent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "insert-time" => Some(("insertTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "target.config" => Some(("target.config", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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!["config", "description", "errors", "fingerprint", "id", "insert-time", "intent", "manifest", "name", "state", "target", "update", "update-time"]); + 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::Deployment = json::value::from_value(object).unwrap(); + let mut call = self.hub.deployments().patch(request, opt.value_of("project").unwrap_or(""), opt.value_of("deployment").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-policy" => { + call = call.update_policy(value.unwrap_or("")); + }, + "delete-policy" => { + call = call.delete_policy(value.unwrap_or("")); + }, + "create-policy" => { + call = call.create_policy(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(["delete-policy", "update-policy", "create-policy"].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 _deployments_update(&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()[..] { + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.errors" => Some(("update.errors", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "update.manifest" => Some(("update.manifest", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manifest" => Some(("manifest", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "intent" => Some(("intent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "insert-time" => Some(("insertTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "target.config" => Some(("target.config", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", 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!["config", "description", "errors", "fingerprint", "id", "insert-time", "intent", "manifest", "name", "state", "target", "update", "update-time"]); + 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::Deployment = json::value::from_value(object).unwrap(); + let mut call = self.hub.deployments().update(request, opt.value_of("project").unwrap_or(""), opt.value_of("deployment").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-policy" => { + call = call.update_policy(value.unwrap_or("")); + }, + "delete-policy" => { + call = call.delete_policy(value.unwrap_or("")); + }, + "create-policy" => { + call = call.create_policy(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(["delete-policy", "update-policy", "create-policy"].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 _manifests_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.manifests().get(opt.value_of("project").unwrap_or(""), opt.value_of("deployment").unwrap_or(""), opt.value_of("manifest").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 _manifests_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.manifests().list(opt.value_of("project").unwrap_or(""), opt.value_of("deployment").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("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "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", "max-results"].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("project").unwrap_or(""), opt.value_of("operation").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("project").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("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "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", "max-results"].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 _resources_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.resources().get(opt.value_of("project").unwrap_or(""), opt.value_of("deployment").unwrap_or(""), opt.value_of("resource").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 _resources_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.resources().list(opt.value_of("project").unwrap_or(""), opt.value_of("deployment").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("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "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", "max-results"].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 _types_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.types().list(opt.value_of("project").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("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "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", "max-results"].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() { + ("deployments", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._deployments_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._deployments_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._deployments_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._deployments_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._deployments_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._deployments_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("deployments".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("manifests", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._manifests_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._manifests_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("manifests".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("operations", Some(opt)) => { + match opt.subcommand() { + ("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(); + } + } + }, + ("resources", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._resources_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._resources_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("resources".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("types", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._types_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("types".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + _ => { + err.issues.push(CLIError::MissingCommandError); + writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); + } + } + + if dry_run { + if err.issues.len() > 0 { + err_opt = Some(err); + } + Err(err_opt) + } else { + Ok(call_result) + } + } + + // Please note that this call will fail if any part of the opt can't be handled + fn new(opt: ArgMatches<'a, 'n>) -> Result, InvalidOptionsError> { + let (config_dir, secret) = { + let config_dir = match cmn::assure_config_dir_exists(opt.value_of("folder").unwrap_or("~/.google-service-cli")) { + Err(e) => return Err(InvalidOptionsError::single(e, 3)), + Ok(p) => p, + }; + + match cmn::application_secret_from_directory(&config_dir, "deploymentmanager2-beta2-secret.json", + "{\"installed\":{\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_secret\":\"hCsslbCUyfehWMmbkG8vTYxG\",\"token_uri\":\"https://accounts.google.com/o/oauth2/token\",\"client_email\":\"\",\"redirect_uris\":[\"urn:ietf:wg:oauth:2.0:oob\",\"oob\"],\"client_x509_cert_url\":\"\",\"client_id\":\"620010449518-9ngf7o4dhs0dka470npqvor6dc5lqb9b.apps.googleusercontent.com\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\"}}") { + Ok(secret) => (config_dir, secret), + Err(e) => return Err(InvalidOptionsError::single(e, 4)) + } + }; + + let auth = Authenticator::new( &secret, DefaultAuthenticatorDelegate, + if opt.is_present("debug-auth") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::::default() + }) + } else { + hyper::Client::new() + }, + JsonTokenStorage { + program_name: "deploymentmanager2-beta2", + db_dir: config_dir.clone(), + }, None); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpsConnector::::default() + }) + } else { + hyper::Client::new() + }; + let engine = Engine { + opt: opt, + hub: api::DeploymentManager::new(client, auth), + gp: vec!["alt", "fields", "key", "oauth-token", "pretty-print", "quota-user", "user-ip"], + gpm: vec![ + ("oauth-token", "oauth_token"), + ("pretty-print", "prettyPrint"), + ("quota-user", "quotaUser"), + ("user-ip", "userIp"), + ] + }; + + match engine._doit(true) { + Err(Some(err)) => Err(err), + Err(None) => Ok(engine), + Ok(_) => unreachable!(), + } + } + + fn doit(&self) -> Result<(), DoitError> { + match self._doit(false) { + Ok(res) => res, + Err(_) => unreachable!(), + } + } +} + +fn main() { + let mut exit_status = 0i32; + let arg_data = [ + ("deployments", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("delete", + Some(r##"Deletes a deployment and all of the resources in the deployment."##), + "Details at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli/deployments_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"deployment"##), + None, + Some(r##"The name of the deployment for this request."##), + 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 information about a specific deployment."##), + "Details at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli/deployments_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"deployment"##), + None, + Some(r##"The name of the deployment for this request."##), + 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)), + ]), + ("insert", + Some(r##"Creates a deployment and all of the resources described by the deployment manifest."##), + "Details at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli/deployments_insert", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + 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)), + ]), + ("list", + Some(r##"Lists all deployments for a given project."##), + "Details at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli/deployments_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + 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 deployment and all of the resources described by the deployment manifest. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli/deployments_patch", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"deployment"##), + None, + Some(r##"The name of the deployment for this request."##), + 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)), + ]), + ("update", + Some(r##"Updates a deployment and all of the resources described by the deployment manifest."##), + "Details at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli/deployments_update", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"deployment"##), + None, + Some(r##"The name of the deployment for this request."##), + 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)), + ]), + ]), + + ("manifests", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets information about a specific manifest."##), + "Details at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli/manifests_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"deployment"##), + None, + Some(r##"The name of the deployment for this request."##), + Some(true), + Some(false)), + + (Some(r##"manifest"##), + None, + Some(r##"The name of the manifest for this request."##), + 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 all manifests for a given deployment."##), + "Details at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli/manifests_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"deployment"##), + None, + Some(r##"The name of the deployment for this request."##), + 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)), + ]), + ]), + + ("operations", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets information about a specific operation."##), + "Details at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli/operations_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"operation"##), + None, + Some(r##"The name of the operation for this request."##), + 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 all operations for a project."##), + "Details at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli/operations_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + 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)), + ]), + ]), + + ("resources", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Gets information about a single resource."##), + "Details at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli/resources_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"deployment"##), + None, + Some(r##"The name of the deployment for this request."##), + Some(true), + Some(false)), + + (Some(r##"resource"##), + None, + Some(r##"The name of the resource for this request."##), + 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 all resources in a given deployment."##), + "Details at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli/resources_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"deployment"##), + None, + Some(r##"The name of the deployment for this request."##), + 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)), + ]), + ]), + + ("types", "methods: 'list'", vec![ + ("list", + Some(r##"Lists all resource types for Deployment Manager."##), + "Details at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli/types_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + 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)), + ]), + ]), + + ]; + + let mut app = App::new("deploymentmanager2-beta2") + .author("Sebastian Thiel ") + .version("0.3.0+20150616") + .about("The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_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") + .multiple(false) + .takes_value(true)) + .arg(Arg::with_name("debug") + .long("debug") + .help("Output all server communication to standard error. `tx` and `rx` are placed into the same stream.") + .multiple(false) + .takes_value(false)) + .arg(Arg::with_name("debug-auth") + .long("debug-auth") + .help("Output all communication related to authentication to standard error. `tx` and `rx` are placed into the same stream.") + .multiple(false) + .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); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::new(sub_command_name); + if let &Some(desc) = desc { + scmd = scmd.about(desc); + } + scmd = scmd.after_help(url_info); + + for &(ref arg_name, ref flag, ref desc, ref required, ref multi) in args { + let arg_name_str = + match (arg_name, flag) { + (&Some(an), _ ) => an, + (_ , &Some(f)) => f, + _ => unreachable!(), + }; + let mut arg = Arg::with_name(arg_name_str) + .empty_values(false); + if let &Some(short_flag) = flag { + arg = arg.short(short_flag); + } + if let &Some(desc) = desc { + arg = arg.help(desc); + } + if arg_name.is_some() && flag.is_some() { + arg = arg.takes_value(true); + } + if let &Some(required) = required { + arg = arg.required(required); + } + if let &Some(multi) = multi { + arg = arg.multiple(multi); + } + scmd = scmd.arg(arg); + } + mcmd = mcmd.subcommand(scmd); + } + app = app.subcommand(mcmd); + } + + let matches = app.get_matches(); + + let debug = matches.is_present("debug"); + match Engine::new(matches) { + Err(err) => { + exit_status = err.exit_code; + writeln!(io::stderr(), "{}", err).ok(); + }, + Ok(engine) => { + if let Err(doit_err) = engine.doit() { + exit_status = 1; + match doit_err { + DoitError::IoError(path, err) => { + writeln!(io::stderr(), "Failed to open output file '{}': {}", path, err).ok(); + }, + DoitError::ApiError(err) => { + if debug { + writeln!(io::stderr(), "{:?}", err).ok(); + } else { + writeln!(io::stderr(), "{}", err).ok(); + } + } + } + } + } + } + + std::process::exit(exit_status); +} \ No newline at end of file diff --git a/gen/deploymentmanager2_beta2/Cargo.toml b/gen/deploymentmanager2_beta2/Cargo.toml new file mode 100644 index 0000000000..d4a0410096 --- /dev/null +++ b/gen/deploymentmanager2_beta2/Cargo.toml @@ -0,0 +1,28 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-deploymentmanager2_beta2" +version = "0.1.8+20150616" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Deployment Manager (protocol v2beta2)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2_beta2" +homepage = "https://developers.google.com/deployment-manager/" +documentation = "http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2" +license = "MIT" +keywords = ["deploymentmanager", "google", "protocol", "web", "api"] +build = "src/build.rs" + + +[dependencies] +hyper = ">= 0.6.0" +mime = "0.0.12" +serde = ">= 0.4.1" +yup-oauth2 = "*" +url = "*" + +[build-dependencies] +syntex = { version = "*" } +serde_codegen = { version = "*" } + diff --git a/gen/deploymentmanager2_beta2/LICENSE.md b/gen/deploymentmanager2_beta2/LICENSE.md new file mode 100644 index 0000000000..ae22e6ec52 --- /dev/null +++ b/gen/deploymentmanager2_beta2/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015` `Sebastian Thiel` + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the “Software”), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/gen/deploymentmanager2_beta2/README.md b/gen/deploymentmanager2_beta2/README.md new file mode 100644 index 0000000000..1dbfda2248 --- /dev/null +++ b/gen/deploymentmanager2_beta2/README.md @@ -0,0 +1,195 @@ + +The `google-deploymentmanager2_beta2` library allows access to all features of the *Google Deployment Manager* service. + +This documentation was generated from *Deployment Manager* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *deploymentmanager:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. + +Everything else about the *Deployment Manager* *v2_beta2* API can be found at the +[official documentation site](https://developers.google.com/deployment-manager/). +# Features + +Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.DeploymentManager.html) ... + +* [deployments](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.Deployment.html) + * [*delete*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.DeploymentDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.DeploymentGetCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.DeploymentInsertCall.html), [*list*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.DeploymentListCall.html), [*patch*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.DeploymentPatchCall.html) and [*update*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.DeploymentUpdateCall.html) +* [manifests](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.Manifest.html) + * [*get*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.ManifestGetCall.html) and [*list*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.ManifestListCall.html) +* [operations](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.Operation.html) + * [*get*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.OperationGetCall.html) and [*list*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.OperationListCall.html) +* [resources](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.ResourceType.html) + * [*get*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.ResourceGetCall.html) and [*list*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.ResourceListCall.html) +* [types](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.Type.html) + * [*list*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.TypeListCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/struct.DeploymentManager.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.CallBuilder.html) +* **[Resources](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.CallBuilder.html)** + * operations to apply to *Resources* + +All *structures* are marked with applicable traits to further categorize them and ease browsing. + +Generally speaking, you can invoke *Activities* like this: + +```Rust,ignore +let r = hub.resource().activity(...).doit() +``` + +Or specifically ... + +```ignore +let r = hub.deployments().update(...).doit() +let r = hub.deployments().insert(...).doit() +let r = hub.operations().get(...).doit() +let r = hub.deployments().patch(...).doit() +let r = hub.operations().list(...).doit() +let r = hub.deployments().delete(...).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 +specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired. +The `doit()` method performs the actual communication with the server and returns the respective result. + +# Usage + +## Setting up your Project + +To use this library, you would put the following lines into your `Cargo.toml` file: + +```toml +[dependencies] +google-deploymentmanager2_beta2 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate yup_oauth2 as oauth2; +extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +use deploymentmanager2_beta2::Deployment; +use deploymentmanager2_beta2::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use deploymentmanager2_beta2::DeploymentManager; + +// Get an ApplicationSecret instance by some means. It contains the `client_id` and +// `client_secret`, among other things. +let secret: ApplicationSecret = Default::default(); +// Instantiate the authenticator. It will choose a suitable authentication flow for you, +// unless you replace `None` with the desired Flow. +// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +// what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +// retrieve them from storage. +let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, + hyper::Client::new(), + ::default(), None); +let mut hub = DeploymentManager::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 = Deployment::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.deployments().update(req, "project", "deployment") + .update_policy("Stet") + .delete_policy("sed") + .create_policy("et") + .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_deploymentmanager2_beta2/enum.Result.html) enumeration as return value of +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.Delegate.html), or the [Authenticator Delegate](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/../yup-oauth2/trait.AuthenticatorDelegate.html). + +When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This +makes the system potentially resilient to all kinds of errors. + +## Uploads and Downloads +If a method supports downloads, the response body, which is part of the [Result](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.ResponseResult.html), it will return that by default. +You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making +this call: `.param("alt", "media")`. + +Methods supporting uploads can do so using up to 2 different protocols: +*simple* and *resumable*. The distinctiveness of each is represented by customized +`doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively. + +## Customization and Callbacks + +You may alter the way an `doit()` method is called by providing a [delegate](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.Delegate.html) to the +[Method Builder](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.CallBuilder.html) before making the final `doit()` call. +Respective methods will be called to provide progress information, as well as determine whether the system should +retry on failure. + +The [delegate trait](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. + +## Optional Parts in Server-Requests + +All structures provided by this library are made to be [enocodable](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.RequestValue.html) and +[decodable](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.Part.html) which are identifiable by name, which will be sent to +the server to indicate either the set parts of the request or the desired parts in the response. + +## Builder Arguments + +Using [method builders](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +These will always take a single argument, for which the following statements are true. + +* [PODs][wiki-pod] are handed by copy +* strings are passed as `&str` +* [request values](http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2/trait.RequestValue.html) are moved + +Arguments will always be copied or cloned into the builder, to make them independent of their original life times. + +[wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure +[builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern +[google-go-api]: https://github.com/google/google-api-go-client + +# License +The **deploymentmanager2_beta2** library was generated by Sebastian Thiel, and is placed +under the *MIT* license. +You can read the full text at the repository's [license file][repo-license]. + +[repo-license]: https://github.com/Byron/google-apis-rs/LICENSE.md diff --git a/gen/deploymentmanager2_beta2/src/build.rs b/gen/deploymentmanager2_beta2/src/build.rs new file mode 100644 index 0000000000..4432190e78 --- /dev/null +++ b/gen/deploymentmanager2_beta2/src/build.rs @@ -0,0 +1,16 @@ +extern crate syntex; +extern crate serde_codegen; + +use std::env; +use std::path::Path; + +pub fn main() { + let out_dir = env::var_os("OUT_DIR").unwrap(); + + let src = Path::new("src/lib.rs.in"); + let dst = Path::new(&out_dir).join("lib.rs"); + + let mut registry = syntex::Registry::new(); + serde_codegen::register(&mut registry); + registry.expand("google-deploymentmanager2_beta2", &src, &dst).unwrap(); +} diff --git a/gen/deploymentmanager2_beta2/src/cmn.rs b/gen/deploymentmanager2_beta2/src/cmn.rs new file mode 100644 index 0000000000..defecc802c --- /dev/null +++ b/gen/deploymentmanager2_beta2/src/cmn.rs @@ -0,0 +1,762 @@ +// COPY OF 'src/rust/api/cmn.rs' +// DO NOT EDIT +use std::io::{self, Read, Seek, Cursor, Write, SeekFrom}; +use std; +use std::fmt::{self, Display}; +use std::str::FromStr; +use std::error; +use std::thread::sleep_ms; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat}; +use hyper::http::h1::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde; + +/// Identifies the Hub. There is only one per library, this trait is supposed +/// to make intended use more explicit. +/// The hub allows to access all resource methods more easily. +pub trait Hub {} + +/// Identifies types for building methods of a particular resource type +pub trait MethodsBuilder {} + +/// Identifies types which represent builders for a particular resource method +pub trait CallBuilder {} + +/// Identifies types which can be inserted and deleted. +/// Types with this trait are most commonly used by clients of this API. +pub trait Resource {} + +/// Identifies types which are used in API responses. +pub trait ResponseResult {} + +/// Identifies types which are used in API requests. +pub trait RequestValue {} + +/// Identifies types which are not actually used by the API +/// This might be a bug within the google API schema. +pub trait UnusedType {} + +/// Identifies types which are only used as part of other types, which +/// usually are carrying the `Resource` trait. +pub trait Part {} + +/// Identifies types which are only used by other types internally. +/// They have no special meaning, this trait just marks them for completeness. +pub trait NestedType {} + +/// A utility to specify reader types which provide seeking capabilities too +pub trait ReadSeek: Seek + Read {} +impl ReadSeek for T {} + +/// A trait for all types that can convert themselves into a *parts* string +pub trait ToParts { + fn to_parts(&self) -> String; +} + +/// A utility type which can decode a server response that indicates error +#[derive(Deserialize)] +pub struct JsonServerError { + pub error: String, + pub error_description: Option +} + +/// A utility to represent detailed errors we might see in case there are BadRequests. +/// The latter happen if the sent parameters or request structures are unsound +#[derive(Deserialize, Serialize, Debug)] +pub struct ErrorResponse { + error: ServerError, +} + +#[derive(Deserialize, Serialize, Debug)] +pub struct ServerError { + errors: Vec, + code: u16, + message: String, +} + +#[derive(Deserialize, Serialize, Debug)] +pub struct ServerMessage { + domain: String, + reason: String, + message: String, + #[serde(rename="locationType")] + location_type: Option, + location: Option +} + +#[derive(Copy, Clone)] +pub struct DummyNetworkStream; + +impl Read for DummyNetworkStream { + fn read(&mut self, _: &mut [u8]) -> io::Result { + Ok(0) + } +} + +impl Write for DummyNetworkStream { + fn write(&mut self, _: &[u8]) -> io::Result { + Ok(0) + } + + fn flush(&mut self) -> io::Result<()> { + Ok(()) + } +} + +impl hyper::net::NetworkStream for DummyNetworkStream { + fn peer_addr(&mut self) -> io::Result { + Ok("127.0.0.1:1337".parse().unwrap()) + } +} + + +/// A trait specifying functionality to help controlling any request performed by the API. +/// The trait has a conservative default implementation. +/// +/// It contains methods to deal with all common issues, as well with the ones related to +/// uploading media +pub trait Delegate { + + /// Called at the beginning of any API request. The delegate should store the method + /// information if he is interesting in knowing more context when further calls to it + /// are made. + /// The matching `finished()` call will always be made, no matter whether or not the API + /// request was successful. That way, the delegate may easily maintain a clean state + /// between various API calls. + fn begin(&mut self, MethodInfo) {} + + /// Called whenever there is an [HttpError](http://hyperium.github.io/hyper/hyper/error/enum.HttpError.html), usually if there are network problems. + /// + /// If you choose to retry after a duration, the duration should be chosen using the + /// [exponential backoff algorithm](http://en.wikipedia.org/wiki/Exponential_backoff). + /// + /// Return retry information. + fn http_error(&mut self, &hyper::Error) -> Retry { + Retry::Abort + } + + /// Called whenever there is the need for your applications API key after + /// the official authenticator implementation didn't provide one, for some reason. + /// If this method returns None as well, the underlying operation will fail + fn api_key(&mut self) -> Option { + None + } + + /// Called whenever the Authenticator didn't yield a token. The delegate + /// may attempt to provide one, or just take it as a general information about the + /// impending failure. + /// The given Error provides information about why the token couldn't be acquired in the + /// first place + fn token(&mut self, err: &error::Error) -> Option { + let _ = err; + None + } + + /// Called during resumable uploads to provide a URL for the impending upload. + /// It was saved after a previous call to `store_upload_url(...)`, and if not None, + /// will be used instead of asking the server for a new upload URL. + /// This is useful in case a previous resumable upload was aborted/canceled, but should now + /// be resumed. + /// The returned URL will be used exactly once - if it fails again and the delegate allows + /// to retry, we will ask the server for a new upload URL. + fn upload_url(&mut self) -> Option { + None + } + + /// Called after we have retrieved a new upload URL for a resumable upload to store it + /// in case we fail or cancel. That way, we can attempt to resume the upload later, + /// see `upload_url()`. + /// It will also be called with None after a successful upload, which allows the delegate + /// to forget the URL. That way, we will not attempt to resume an upload that has already + /// finished. + fn store_upload_url(&mut self, url: Option<&str>) { + let _ = url; + } + + /// Called whenever a server response could not be decoded from json. + /// It's for informational purposes only, the caller will return with an error + /// accordingly. + /// + /// # Arguments + /// + /// * `json_encoded_value` - The json-encoded value which failed to decode. + /// * `json_decode_error` - The decoder error + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + let _ = json_encoded_value; + let _ = json_decode_error; + } + + /// Called whenever the http request returns with a non-success status code. + /// This can involve authentication issues, or anything else that very much + /// depends on the used API method. + /// The delegate should check the status, header and decoded json error to decide + /// whether to retry or not. In the latter case, the underlying call will fail. + /// + /// If you choose to retry after a duration, the duration should be chosen using the + /// [exponential backoff algorithm](http://en.wikipedia.org/wiki/Exponential_backoff). + fn http_failure(&mut self, _: &hyper::client::Response, Option, _: Option) -> Retry { + Retry::Abort + } + + /// Called prior to sending the main request of the given method. It can be used to time + /// the call or to print progress information. + /// It's also useful as you can be sure that a request will definitely be made. + fn pre_request(&mut self) { } + + /// Return the size of each chunk of a resumable upload. + /// Must be a power of two, with 1<<18 being the smallest allowed chunk size. + /// Will be called once before starting any resumable upload. + fn chunk_size(&mut self) -> u64 { + 1 << 23 + } + + /// Called before the given chunk is uploaded to the server. + /// If true is returned, the upload will be interrupted. + /// However, it may be resumable if you stored the upload URL in a previous call + /// to `store_upload_url()` + fn cancel_chunk_upload(&mut self, chunk: &ContentRange) -> bool { + let _ = chunk; + false + } + + /// Called before the API request method returns, in every case. It can be used to clean up + /// internal state between calls to the API. + /// This call always has a matching call to `begin(...)`. + /// + /// # Arguments + /// + /// * `is_success` - a true value indicates the operation was successful. If false, you should + /// discard all values stored during `store_upload_url`. + fn finished(&mut self, is_success: bool) { + let _ = is_success; + } +} + +/// A delegate with a conservative default implementation, which is used if no other delegate is +/// set. +#[derive(Default)] +pub struct DefaultDelegate; + +impl Delegate for DefaultDelegate {} + + +#[derive(Debug)] +pub enum Error { + /// The http connection failed + HttpError(hyper::Error), + + /// An attempt was made to upload a resource with size stored in field `.0` + /// even though the maximum upload size is what is stored in field `.1`. + UploadSizeLimitExceeded(u64, u64), + + /// Represents information about a request that was not understood by the server. + /// Details are included. + BadRequest(ErrorResponse), + + /// We needed an API key for authentication, but didn't obtain one. + /// Neither through the authenticator, nor through the Delegate. + MissingAPIKey, + + /// We required a Token, but didn't get one from the Authenticator + MissingToken(Box), + + /// The delgate instructed to cancel the operation + Cancelled, + + /// An additional, free form field clashed with one of the built-in optional ones + FieldClash(&'static str), + + /// Shows that we failed to decode the server response. + /// This can happen if the protocol changes in conjunction with strict json decoding. + JsonDecodeError(String, serde::json::Error), + + /// Indicates an HTTP repsonse with a non-success status code + Failure(hyper::client::Response), +} + + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + Error::HttpError(ref err) => err.fmt(f), + Error::UploadSizeLimitExceeded(ref resource_size, ref max_size) => + writeln!(f, "The media size {} exceeds the maximum allowed upload size of {}" + , resource_size, max_size), + Error::MissingAPIKey => { + (writeln!(f, "The application's API key was not found in the configuration")).ok(); + writeln!(f, "It is used as there are no Scopes defined for this method.") + }, + Error::BadRequest(ref err) => { + try!(writeln!(f, "Bad Requst ({}): {}", err.error.code, err.error.message)); + for err in err.error.errors.iter() { + try!(writeln!(f, " {}: {}, {}{}", + err.domain, + err.message, + err.reason, + match &err.location { + &Some(ref loc) => format!("@{}", loc), + &None => String::new(), + })); + } + Ok(()) + }, + Error::MissingToken(ref err) => + writeln!(f, "Token retrieval failed with error: {}", err), + Error::Cancelled => + writeln!(f, "Operation cancelled by delegate"), + Error::FieldClash(field) => + writeln!(f, "The custom parameter '{}' is already provided natively by the CallBuilder.", field), + Error::JsonDecodeError(ref json_str, ref err) + => writeln!(f, "{}: {}", err, json_str), + Error::Failure(ref response) => + writeln!(f, "Http status indicates failure: {:?}", response), + } + } +} + +impl error::Error for Error { + fn description(&self) -> &str { + match *self { + Error::HttpError(ref err) => err.description(), + Error::JsonDecodeError(_, ref err) => err.description(), + _ => "NO DESCRIPTION POSSIBLE - use `Display.fmt()` instead" + } + } + + fn cause(&self) -> Option<&error::Error> { + match *self { + Error::HttpError(ref err) => err.cause(), + Error::JsonDecodeError(_, ref err) => err.cause(), + _ => None + } + } +} + +/// A universal result type used as return for all calls. +pub type Result = std::result::Result; + +/// Contains information about an API request. +pub struct MethodInfo { + pub id: &'static str, + pub http_method: Method, +} + +const BOUNDARY: &'static str = "MDuXWGyeE33QFXGchb2VFWc4Z7945d"; + +/// Provides a `Read` interface that converts multiple parts into the protocol +/// identified by [RFC2387](https://tools.ietf.org/html/rfc2387). +/// **Note**: This implementation is just as rich as it needs to be to perform uploads +/// to google APIs, and might not be a fully-featured implementation. +#[derive(Default)] +pub struct MultiPartReader<'a> { + raw_parts: Vec<(Headers, &'a mut Read)>, + current_part: Option<(Cursor>, &'a mut Read)>, + last_part_boundary: Option>>, +} + +impl<'a> MultiPartReader<'a> { + + /// Reserve memory for exactly the given amount of parts + pub fn reserve_exact(&mut self, cap: usize) { + self.raw_parts.reserve_exact(cap); + } + + /// Add a new part to the queue of parts to be read on the first `read` call. + /// + /// # Arguments + /// + /// `headers` - identifying the body of the part. It's similar to the header + /// in an ordinary single-part call, and should thus contain the + /// same information. + /// `reader` - a reader providing the part's body + /// `size` - the amount of bytes provided by the reader. It will be put onto the header as + /// content-size. + /// `mime` - It will be put onto the content type + pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { + let mut headers = Headers::new(); + headers.set(ContentType(mime_type)); + headers.set(ContentLength(size)); + self.raw_parts.push((headers, reader)); + self + } + + /// Returns the mime-type representing our multi-part message. + /// Use it with the ContentType header. + pub fn mime_type(&self) -> Mime { + Mime( + TopLevel::Multipart, + SubLevel::Ext("Related".to_string()), + vec![(Attr::Ext("boundary".to_string()), Value::Ext(BOUNDARY.to_string()))], + ) + } + + /// Returns true if we are totally used + fn is_depleted(&self) -> bool { + self.raw_parts.len() == 0 && self.current_part.is_none() && self.last_part_boundary.is_none() + } + + /// Returns true if we are handling our last part + fn is_last_part(&self) -> bool { + self.raw_parts.len() == 0 && self.current_part.is_some() + } +} + +impl<'a> Read for MultiPartReader<'a> { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + match (self.raw_parts.len(), + self.current_part.is_none(), + self.last_part_boundary.is_none()) { + (_, _, false) => { + let br = self.last_part_boundary.as_mut().unwrap().read(buf).unwrap_or(0); + if br < buf.len() { + self.last_part_boundary = None; + } + return Ok(br) + }, + (0, true, true) => return Ok(0), + (n, true, _) if n > 0 => { + let (headers, reader) = self.raw_parts.remove(0); + let mut c = Cursor::new(Vec::::new()); + (write!(&mut c, "{}--{}{}{}{}", LINE_ENDING, BOUNDARY, LINE_ENDING, + headers, LINE_ENDING)).unwrap(); + c.seek(SeekFrom::Start(0)).unwrap(); + self.current_part = Some((c, reader)); + } + _ => {}, + } + + // read headers as long as possible + let (hb, rr) = { + let &mut (ref mut c, ref mut reader) = self.current_part.as_mut().unwrap(); + let b = c.read(buf).unwrap_or(0); + (b, reader.read(&mut buf[b..])) + }; + + match rr { + Ok(bytes_read) => { + if hb < buf.len() && bytes_read == 0 { + if self.is_last_part() { + // before clearing the last part, we will add the boundary that + // will be written last + self.last_part_boundary = Some(Cursor::new( + format!("{}--{}--", LINE_ENDING, BOUNDARY).into_bytes())) + } + // We are depleted - this can trigger the next part to come in + self.current_part = None; + } + let mut total_bytes_read = hb + bytes_read; + while total_bytes_read < buf.len() && !self.is_depleted() { + match self.read(&mut buf[total_bytes_read ..]) { + Ok(br) => total_bytes_read += br, + Err(err) => return Err(err), + } + } + Ok(total_bytes_read) + } + Err(err) => { + // fail permanently + self.current_part = None; + self.last_part_boundary = None; + self.raw_parts.clear(); + Err(err) + } + } + } +} + +// The following macro invocation needs to be expanded, as `include!` +// doens't support external macros +// header!{ +// #[doc="The `X-Upload-Content-Type` header."] +// (XUploadContentType, "X-Upload-Content-Type") => [Mime] + +// xupload_content_type { +// test_header!( +// test1, +// vec![b"text/plain"], +// Some(HeaderField( +// vec![Mime(TopLevel::Text, SubLevel::Plain, Vec::new())] +// ))); + +// } +// } + +/// The `X-Upload-Content-Type` header. +/// +/// Generated via rustc --pretty expanded -Z unstable-options, and manually +/// processed to be more readable. +#[derive(PartialEq, Debug, Clone)] +pub struct XUploadContentType(pub Mime); + +impl ::std::ops::Deref for XUploadContentType { + type Target = Mime; + fn deref<'a>(&'a self) -> &'a Mime { &self.0 } +} +impl ::std::ops::DerefMut for XUploadContentType { + fn deref_mut<'a>(&'a mut self) -> &'a mut Mime { &mut self.0 } +} +impl Header for XUploadContentType { + fn header_name() -> &'static str { "X-Upload-Content-Type" } + fn parse_header(raw: &[Vec]) -> hyper::error::Result { + hyper::header::parsing::from_one_raw_str(raw).map(XUploadContentType) + } +} +impl HeaderFormat for XUploadContentType { + fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result { + Display::fmt(&**self, f) + } +} +impl Display for XUploadContentType { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&**self, f) + } +} + +#[derive(Clone, PartialEq, Debug)] +pub struct Chunk { + pub first: u64, + pub last: u64 +} + +impl fmt::Display for Chunk { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + (write!(fmt, "{}-{}", self.first, self.last)).ok(); + Ok(()) + } +} + +impl FromStr for Chunk { + type Err = &'static str; + + /// NOTE: only implements `%i-%i`, not `*` + fn from_str(s: &str) -> std::result::Result { + let parts: Vec<&str> = s.split('-').collect(); + if parts.len() != 2 { + return Err("Expected two parts: %i-%i") + } + Ok( + Chunk { + first: match FromStr::from_str(parts[0]) { + Ok(d) => d, + _ => return Err("Couldn't parse 'first' as digit") + }, + last: match FromStr::from_str(parts[1]) { + Ok(d) => d, + _ => return Err("Couldn't parse 'last' as digit") + } + } + ) + } +} + +/// Implements the Content-Range header, for serialization only +#[derive(Clone, PartialEq, Debug)] +pub struct ContentRange { + pub range: Option, + pub total_length: u64, +} + +impl Header for ContentRange { + fn header_name() -> &'static str { + "Content-Range" + } + + /// We are not parsable, as parsing is done by the `Range` header + fn parse_header(_: &[Vec]) -> hyper::error::Result { + Err(hyper::error::Error::Method) + } +} + + +impl HeaderFormat for ContentRange { + fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + try!(fmt.write_str("bytes ")); + match self.range { + Some(ref c) => try!(c.fmt(fmt)), + None => try!(fmt.write_str("*")) + } + (write!(fmt, "/{}", self.total_length)).ok(); + Ok(()) + } +} + +#[derive(Clone, PartialEq, Debug)] +pub struct RangeResponseHeader(pub Chunk); + +impl Header for RangeResponseHeader { + fn header_name() -> &'static str { + "Range" + } + + 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 Ok(RangeResponseHeader(c)) + } + } + } + } + Err(hyper::error::Error::Method) + } +} + +impl HeaderFormat for RangeResponseHeader { + /// No implmentation necessary, we just need to parse + fn fmt_header(&self, _: &mut fmt::Formatter) -> fmt::Result { + Err(fmt::Error) + } +} + +/// A utility type to perform a resumable upload from start to end. +pub struct ResumableUploadHelper<'a, A: 'a> { + pub client: &'a mut hyper::client::Client, + pub delegate: &'a mut Delegate, + pub start_at: Option, + pub auth: &'a mut A, + pub user_agent: &'a str, + pub auth_header: Authorization, + pub url: &'a str, + pub reader: &'a mut ReadSeek, + pub media_type: Mime, + pub content_length: u64 +} + +impl<'a, A> ResumableUploadHelper<'a, A> + where A: oauth2::GetToken { + + fn query_transfer_status(&mut self) -> std::result::Result> { + loop { + match self.client.post(self.url) + .header(UserAgent(self.user_agent.to_string())) + .header(ContentRange { range: None, total_length: self.content_length }) + .header(self.auth_header.clone()) + .send() { + Ok(r) => { + // 308 = resume-incomplete == PermanentRedirect + let headers = r.headers.clone(); + let h: &RangeResponseHeader = match headers.get() { + Some(hh) if r.status == StatusCode::PermanentRedirect => hh, + None|Some(_) => { + if let Retry::After(d) = self.delegate.http_failure(&r, None, None) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + return Err(Err(err)) + } + } + } + } + + /// returns None if operation was cancelled by delegate, or the HttpResult. + /// It can be that we return the result just because we didn't understand the status code - + /// caller should check for status himself before assuming it's OK to use + pub fn upload(&mut self) -> Option> { + let mut start = match self.start_at { + Some(s) => s, + None => match self.query_transfer_status() { + Ok(s) => s, + Err(result) => return Some(result) + } + }; + + const MIN_CHUNK_SIZE: u64 = 1 << 18; + let chunk_size = match self.delegate.chunk_size() { + cs if cs > MIN_CHUNK_SIZE => cs, + _ => MIN_CHUNK_SIZE + }; + + self.reader.seek(SeekFrom::Start(start)).unwrap(); + loop { + let request_size = match self.content_length - start { + rs if rs > chunk_size => chunk_size, + rs => rs + }; + + let mut section_reader = self.reader.take(request_size); + let range_header = ContentRange { + range: Some(Chunk {first: start, last: start + request_size - 1}), + total_length: self.content_length + }; + start += request_size; + if self.delegate.cancel_chunk_upload(&range_header) { + return None + } + // workaround https://github.com/rust-lang/rust/issues/22252 + let res = self.client.post(self.url) + .header(range_header) + .header(ContentType(self.media_type.clone())) + .header(UserAgent(self.user_agent.to_string())) + .body(&mut section_reader) + .send(); + match res { + Ok(mut res) => { + if res.status == StatusCode::PermanentRedirect { + continue + } + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let Retry::After(d) = self.delegate.http_failure(&res, + serde::json::from_str(&json_err).ok(), + serde::json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + return Some(Err(err)) + } + } + } + } +} + +// Copy of src/rust/cli/cmn.rs +// TODO(ST): Allow sharing common code between program types +pub fn remove_json_null_values(value: &mut serde::json::value::Value) { + match *value { + serde::json::value::Value::Object(ref mut map) => { + let mut for_removal = Vec::new(); + + for (key, mut value) in map.iter_mut() { + if value.is_null() { + for_removal.push(key.clone()); + } else { + remove_json_null_values(&mut value); + } + } + + for key in &for_removal { + map.remove(key); + } + } + _ => {} + } +} diff --git a/gen/deploymentmanager2_beta2/src/lib.rs b/gen/deploymentmanager2_beta2/src/lib.rs new file mode 100644 index 0000000000..52f328b147 --- /dev/null +++ b/gen/deploymentmanager2_beta2/src/lib.rs @@ -0,0 +1,199 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Deployment Manager* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *deploymentmanager:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! +//! Everything else about the *Deployment Manager* *v2_beta2* API can be found at the +//! [official documentation site](https://developers.google.com/deployment-manager/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2_beta2). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.DeploymentManager.html) ... +//! +//! * [deployments](struct.Deployment.html) +//! * [*delete*](struct.DeploymentDeleteCall.html), [*get*](struct.DeploymentGetCall.html), [*insert*](struct.DeploymentInsertCall.html), [*list*](struct.DeploymentListCall.html), [*patch*](struct.DeploymentPatchCall.html) and [*update*](struct.DeploymentUpdateCall.html) +//! * [manifests](struct.Manifest.html) +//! * [*get*](struct.ManifestGetCall.html) and [*list*](struct.ManifestListCall.html) +//! * [operations](struct.Operation.html) +//! * [*get*](struct.OperationGetCall.html) and [*list*](struct.OperationListCall.html) +//! * [resources](struct.ResourceType.html) +//! * [*get*](struct.ResourceGetCall.html) and [*list*](struct.ResourceListCall.html) +//! * [types](struct.Type.html) +//! * [*list*](struct.TypeListCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](../index.html). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.DeploymentManager.html)** +//! * a central object to maintain state and allow accessing all *Activities* +//! * creates [*Method Builders*](trait.MethodsBuilder.html) which in turn +//! allow access to individual [*Call Builders*](trait.CallBuilder.html) +//! * **[Resources](trait.Resource.html)** +//! * primary types that you can apply *Activities* to +//! * a collection of properties and *Parts* +//! * **[Parts](trait.Part.html)** +//! * a collection of properties +//! * never directly used in *Activities* +//! * **[Activities](trait.CallBuilder.html)** +//! * operations to apply to *Resources* +//! +//! All *structures* are marked with applicable traits to further categorize them and ease browsing. +//! +//! Generally speaking, you can invoke *Activities* like this: +//! +//! ```Rust,ignore +//! let r = hub.resource().activity(...).doit() +//! ``` +//! +//! Or specifically ... +//! +//! ```ignore +//! let r = hub.deployments().update(...).doit() +//! let r = hub.deployments().insert(...).doit() +//! let r = hub.operations().get(...).doit() +//! let r = hub.deployments().patch(...).doit() +//! let r = hub.operations().list(...).doit() +//! let r = hub.deployments().delete(...).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 +//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired. +//! The `doit()` method performs the actual communication with the server and returns the respective result. +//! +//! # Usage +//! +//! ## Setting up your Project +//! +//! To use this library, you would put the following lines into your `Cargo.toml` file: +//! +//! ```toml +//! [dependencies] +//! google-deploymentmanager2_beta2 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +//! use deploymentmanager2_beta2::Deployment; +//! use deploymentmanager2_beta2::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use deploymentmanager2_beta2::DeploymentManager; +//! +//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and +//! // `client_secret`, among other things. +//! let secret: ApplicationSecret = Default::default(); +//! // Instantiate the authenticator. It will choose a suitable authentication flow for you, +//! // unless you replace `None` with the desired Flow. +//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +//! // retrieve them from storage. +//! let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +//! hyper::Client::new(), +//! ::default(), None); +//! let mut hub = DeploymentManager::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 = Deployment::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.deployments().update(req, "project", "deployment") +//! .update_policy("consetetur") +//! .delete_policy("ut") +//! .create_policy("ea") +//! .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 +//! the doit() methods, or handed as possibly intermediate results to either the +//! [Hub Delegate](trait.Delegate.html), or the [Authenticator Delegate](../yup-oauth2/trait.AuthenticatorDelegate.html). +//! +//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This +//! makes the system potentially resilient to all kinds of errors. +//! +//! ## Uploads and Downloads +//! If a method supports downloads, the response body, which is part of the [Result](enum.Result.html), should be +//! read by you to obtain the media. +//! If such a method also supports a [Response Result](trait.ResponseResult.html), it will return that by default. +//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making +//! this call: `.param("alt", "media")`. +//! +//! Methods supporting uploads can do so using up to 2 different protocols: +//! *simple* and *resumable*. The distinctiveness of each is represented by customized +//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively. +//! +//! ## Customization and Callbacks +//! +//! You may alter the way an `doit()` method is called by providing a [delegate](trait.Delegate.html) to the +//! [Method Builder](trait.CallBuilder.html) before making the final `doit()` call. +//! Respective methods will be called to provide progress information, as well as determine whether the system should +//! retry on failure. +//! +//! The [delegate trait](trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +//! +//! ## Optional Parts in Server-Requests +//! +//! All structures provided by this library are made to be [enocodable](trait.RequestValue.html) and +//! [decodable](trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +//! are valid. +//! Most optionals are are considered [Parts](trait.Part.html) which are identifiable by name, which will be sent to +//! the server to indicate either the set parts of the request or the desired parts in the response. +//! +//! ## Builder Arguments +//! +//! Using [method builders](trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +//! These will always take a single argument, for which the following statements are true. +//! +//! * [PODs][wiki-pod] are handed by copy +//! * strings are passed as `&str` +//! * [request values](trait.RequestValue.html) are moved +//! +//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times. +//! +//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure +//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern +//! [google-go-api]: https://github.com/google/google-api-go-client +//! +//! + +// Unused attributes happen thanks to defined, but unused structures +// We don't warn about this, as depending on the API, some data structures or facilities are never used. +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// unused imports in fully featured APIs. Same with unused_mut ... . +#![allow(unused_imports, unused_mut, dead_code)] + +include!(concat!(env!("OUT_DIR"), "/lib.rs")); \ No newline at end of file diff --git a/gen/deploymentmanager2_beta2/src/lib.rs.in b/gen/deploymentmanager2_beta2/src/lib.rs.in new file mode 100644 index 0000000000..b21eb1d82f --- /dev/null +++ b/gen/deploymentmanager2_beta2/src/lib.rs.in @@ -0,0 +1,4680 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.in.mako' +// DO NOT EDIT ! + +extern crate hyper; +extern crate serde; +extern crate yup_oauth2 as oauth2; +extern crate mime; +extern crate url; + +mod cmn; + +use std::collections::HashMap; +use std::cell::RefCell; +use std::borrow::BorrowMut; +use std::default::Default; +use std::collections::BTreeMap; +use serde::json; +use std::io; +use std::fs; +use std::thread::sleep_ms; + +pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, Hub, ReadSeek, Part, + ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder, + Resource, ErrorResponse, remove_json_null_values}; + + +// ############## +// 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 { + /// View your Google Cloud Platform management resources and deployment status information + NdevCloudmanReadonly, + + /// View and manage your data across Google Cloud Platform services + CloudPlatform, + + /// View and manage your Google Cloud Platform management resources and deployment status information + NdevCloudman, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::NdevCloudmanReadonly => "https://www.googleapis.com/auth/ndev.cloudman.readonly", + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + Scope::NdevCloudman => "https://www.googleapis.com/auth/ndev.cloudman", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::NdevCloudmanReadonly + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all DeploymentManager related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// use deploymentmanager2_beta2::Deployment; +/// use deploymentmanager2_beta2::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use deploymentmanager2_beta2::DeploymentManager; +/// +/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and +/// // `client_secret`, among other things. +/// let secret: ApplicationSecret = Default::default(); +/// // Instantiate the authenticator. It will choose a suitable authentication flow for you, +/// // unless you replace `None` with the desired Flow. +/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +/// // retrieve them from storage. +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = DeploymentManager::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 = Deployment::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.deployments().update(req, "project", "deployment") +/// .update_policy("accusam") +/// .delete_policy("takimata") +/// .create_policy("justo") +/// .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 DeploymentManager { + client: RefCell, + auth: RefCell, + _user_agent: String, +} + +impl<'a, C, A> Hub for DeploymentManager {} + +impl<'a, C, A> DeploymentManager + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> DeploymentManager { + DeploymentManager { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/0.1.8".to_string(), + } + } + + pub fn deployments(&'a self) -> DeploymentMethods<'a, C, A> { + DeploymentMethods { hub: &self } + } + pub fn manifests(&'a self) -> ManifestMethods<'a, C, A> { + ManifestMethods { hub: &self } + } + pub fn operations(&'a self) -> OperationMethods<'a, C, A> { + OperationMethods { hub: &self } + } + pub fn resources(&'a self) -> ResourceMethods<'a, C, A> { + ResourceMethods { hub: &self } + } + pub fn types(&'a self) -> TypeMethods<'a, C, A> { + TypeMethods { 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`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + let prev = self._user_agent.clone(); + self._user_agent = agent_name; + prev + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ImportFile { + /// The contents of the file. + pub content: Option, + /// The name of the file. + pub name: Option, +} + +impl Part for ImportFile {} + + +/// +/// +/// # 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 resources](struct.ResourceGetCall.html) (response) +/// * [list resources](struct.ResourceListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourceType { + /// [Output Only] The evaluated properties of the resource with references expanded. Returned as serialized YAML. + #[serde(rename="finalProperties")] + pub final_properties: Option, + /// [Output Only] Timestamp when the resource was updated, in RFC3339 text format . + #[serde(rename="updateTime")] + pub update_time: Option, + /// [Output Only] The name of the resource as it appears in the YAML config. + pub name: Option, + /// [Output Only] The URL of the actual resource. + pub url: Option, + /// [Output Only] If Deployment Manager is currently updating or previewing an update to this resource, the updated configuration appears here. + pub update: Option, + /// [Output Only] URL of the manifest representing the current configuration of this resource. + pub manifest: Option, + /// [Output Only] The current properties of the resource before any references have been filled in. Returned as serialized YAML. + pub properties: Option, + /// [Output Only] Timestamp when the resource was created or acquired, in RFC3339 text format . + #[serde(rename="insertTime")] + pub insert_time: Option, + /// [Output Only] The type of the resource, for example ?compute.v1.instance?, or ?replicaPools.v1beta2.instanceGroupManager? + #[serde(rename="type")] + pub type_: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, +} + +impl Resource for ResourceType {} +impl ResponseResult for ResourceType {} + + +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationWarningsData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for OperationWarningsData {} +impl Part for OperationWarningsData {} + + +/// [Output Only] If warning messages are generated during processing of the operation, this field will be populated. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationWarnings { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, +} + +impl NestedType for OperationWarnings {} +impl Part for OperationWarnings {} + + +/// A resource type supported by Deployment Manager. +/// +/// # 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 types](struct.TypeListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Type { + /// Name of the type. + pub name: Option, +} + +impl Resource for Type {} + + +/// A response containing a partial list of resources and a page token used to build the next request if the request has been truncated. +/// +/// # 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 resources](struct.ResourceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcesListResponse { + /// A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Resources contained in this list response. + pub resources: Option>, +} + +impl ResponseResult for ResourcesListResponse {} + + +/// [Output Only] The array of errors encountered while processing this 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 OperationErrorErrors { + /// [Output Only] An optional, human-readable error message. + pub message: Option, + /// [Output Only] The error type identifier for this error. + pub code: Option, + /// [Output Only] Indicates the field in the request which caused the error. This property is optional. + pub location: Option, +} + +impl NestedType for OperationErrorErrors {} +impl Part for OperationErrorErrors {} + + +/// +/// +/// # 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 manifests](struct.ManifestListCall.html) (none) +/// * [get manifests](struct.ManifestGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Manifest { + /// [Output Only] The YAML layout for this manifest. + pub layout: Option, + /// [Output Only] The name of the manifest. + pub name: Option, + /// [Output Only] The imported files for this manifest. + pub imports: Option>, + /// [Output Only] The fully-expanded configuration file, including any templates and references. + #[serde(rename="evaluatedConfig")] + pub evaluated_config: Option, + /// [Output Only] Timestamp when the manifest was created, in RFC3339 text format. + #[serde(rename="insertTime")] + pub insert_time: Option, + /// [Output Only] The YAML configuration for this manifest. + pub config: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Self link for the manifest. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl Resource for Manifest {} +impl ResponseResult for Manifest {} + + +/// [Output Only] If errors are generated during processing of the operation, this field will be populated. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationError { + /// [Output Only] The array of errors encountered while processing this operation. + pub errors: Option>, +} + +impl NestedType for OperationError {} +impl Part for OperationError {} + + +/// +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeploymentUpdate { + /// [Output Only] List of all errors encountered while trying to enact the update. + pub errors: Option>, + /// [Output Only] URL of the manifest representing the update configuration of this deployment. + pub manifest: Option, +} + +impl Part for DeploymentUpdate {} + + +/// A response that returns all Types supported by Deployment Manager +/// +/// # 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 types](struct.TypeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TypesListResponse { + /// A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] A list of resource types supported by Deployment Manager. + pub types: Option>, +} + +impl ResponseResult for TypesListResponse {} + + +/// +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetConfiguration { + /// Specifies any files to import for this configuration. This can be used to import templates or other files. For example, you might import a text file in order to use the file in a template. + pub imports: Option>, + /// The configuration to use for this deployment. + pub config: Option, +} + +impl Part for TargetConfiguration {} + + +/// A response containing a partial list of deployments and a page token used to build the next request if the request has been truncated. +/// +/// # 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 deployments](struct.DeploymentListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeploymentsListResponse { + /// [Output Only] A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] The deployments contained in this response. + pub deployments: Option>, +} + +impl ResponseResult for DeploymentsListResponse {} + + +/// +/// +/// # 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*). +/// +/// * [update deployments](struct.DeploymentUpdateCall.html) (request) +/// * [get deployments](struct.DeploymentGetCall.html) (response) +/// * [insert deployments](struct.DeploymentInsertCall.html) (request) +/// * [list deployments](struct.DeploymentListCall.html) (none) +/// * [patch deployments](struct.DeploymentPatchCall.html) (request) +/// * [delete deployments](struct.DeploymentDeleteCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Deployment { + /// [Output Only] Timestamp when the deployment was updated, in RFC3339 text format . + #[serde(rename="updateTime")] + pub update_time: Option, + /// An optional user-provided description of the deployment. + pub description: Option, + /// The name of the deployment, which must be unique within the project. + pub name: Option, + /// [Output Only] If Deployment Manager is currently updating or previewing an update to this deployment, the updated configuration appears here. + pub update: Option, + /// [Output Only] URL of the manifest representing the last manifest that was successfully deployed. + pub manifest: Option, + /// [Output Only] The current state of the deployment. This can be DEPLOYED, DEPLOYMENT_FAILED, PREVIEWING, UPDATING, and CANCELING. + pub state: Option, + /// [Input Only] Specifies how Deployment Manager should apply this template. Possible options are PREVIEW, UPDATE, and CANCEL. + /// + /// PREVIEW creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. You can use this intent to preview updates to deployments or preview new deployments. You must provide a target.config with a configuration for this intent. After previewing a deployment, you can deploy your resources by making a request with the UPDATE intent or you can CANCEL the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + /// + /// UPDATE performs an update to the underlying resources in a deployment. If you provide a populated target.config field with this request, Deployment Manager uses that configuration to perform an update. If you had previewed this update beforehand, and do not supply a target.config or provide an empty target.config, Deployment Manager uses the last previewed configuration. + /// + /// CANCEL cancels an update that is in PREVIEW or UPDATE but does not undo any changes already made. + pub intent: Option, + /// [Output Only] Timestamp when the deployment was created, in RFC3339 text format . + #[serde(rename="insertTime")] + pub insert_time: Option, + /// 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. + pub fingerprint: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Input Only] The parameters that define your deployment, including the deployment configuration and relevant templates. + pub target: Option, +} + +impl RequestValue for Deployment {} +impl Resource for Deployment {} +impl ResponseResult for Deployment {} + + +/// A response containing a partial list of operations and a page token used to build the next request if the request has been truncated. +/// +/// # 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 OperationsListResponse { + /// [Output Only] A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Operations contained in this list response. + pub operations: Option>, +} + +impl ResponseResult for OperationsListResponse {} + + +/// An operation resource, used to manage asynchronous API requests. +/// +/// # 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*). +/// +/// * [update deployments](struct.DeploymentUpdateCall.html) (response) +/// * [insert deployments](struct.DeploymentInsertCall.html) (response) +/// * [get operations](struct.OperationGetCall.html) (response) +/// * [patch deployments](struct.DeploymentPatchCall.html) (response) +/// * [list operations](struct.OperationListCall.html) (none) +/// * [delete deployments](struct.DeploymentDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// [Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE. + pub status: Option, + /// [Output Only] The time that this operation was requested. This is in RFC3339 text format. + #[serde(rename="insertTime")] + pub insert_time: Option, + /// [Output Only] If warning messages are generated during processing of the operation, this field will be populated. + pub warnings: Option>, + /// [Output Only] If errors are generated during processing of the operation, this field will be populated. + pub error: Option, + /// [Output Only] Unique target ID which identifies a particular incarnation of the target. + #[serde(rename="targetId")] + pub target_id: Option, + /// [Output Only] URL of the resource the operation is mutating. + #[serde(rename="targetLink")] + pub target_link: Option, + /// [Output Only] The time that this operation was started by the server. This is in RFC3339 text format. + #[serde(rename="startTime")] + pub start_time: Option, + /// [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project. + #[serde(rename="clientOperationId")] + pub client_operation_id: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Type of the resource. Always compute#Operation for Operation resources. + pub kind: Option, + /// [Output Only] Name of the resource. + pub name: Option, + /// [Output Only] URL of the zone where the operation resides. + pub zone: Option, + /// [Output Only] URL of the region where the operation resides. Only applicable for regional resources. + pub region: Option, + /// [Output Only] Server defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] Type of the operation, such as insert, update, and delete. + #[serde(rename="operationType")] + pub operation_type: Option, + /// [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. + #[serde(rename="httpErrorMessage")] + pub http_error_message: Option, + /// [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should monotonically increase as the operation progresses. + pub progress: Option, + /// [Output Only] The time that this operation was completed. This is in RFC3339 text format. + #[serde(rename="endTime")] + pub end_time: Option, + /// [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404. + #[serde(rename="httpErrorStatusCode")] + pub http_error_status_code: Option, + /// [Output Only] An optional textual description of the current status of the operation. + #[serde(rename="statusMessage")] + pub status_message: Option, + /// [Output Only] User who requested the operation, for example: user@example.com. + pub user: Option, +} + +impl Resource for Operation {} +impl ResponseResult for 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 ResourceUpdate { + /// [Output Only] The expanded properties of the resource with reference values expanded. Returned as serialized YAML. + #[serde(rename="finalProperties")] + pub final_properties: Option, + /// [Output Only] The state of the resource. + pub state: Option, + /// [Output Only] List of all errors encountered while trying to enact update.intent. + pub errors: Option>, + /// [Output Only] The intent of the resource, PREVIEW, UPDATE, or CANCEL. + pub intent: Option, + /// [Output Only] The set of updated properties for this resource, before references are expanded. Returned as serialized YAML. + pub properties: Option, + /// [Output Only] URL of the manifest representing the update configuration of this resource. + pub manifest: Option, +} + +impl Part for ResourceUpdate {} + + +/// A response containing a partial list of manifests and a page token used to build the next request if the request has been truncated. +/// +/// # 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 manifests](struct.ManifestListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManifestsListResponse { + /// [Output Only] A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Manifests contained in this list response. + pub manifests: Option>, +} + +impl ResponseResult for ManifestsListResponse {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *operation* resources. +/// It is not used directly, but through the `DeploymentManager` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use deploymentmanager2_beta2::DeploymentManager; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = DeploymentManager::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `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 DeploymentManager, +} + +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: + /// + /// Gets information about a specific operation. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + /// * `operation` - The name of the operation for this request. + pub fn get(&self, project: &str, operation: &str) -> OperationGetCall<'a, C, A> { + OperationGetCall { + hub: self.hub, + _project: project.to_string(), + _operation: operation.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all operations for a project. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + pub fn list(&self, project: &str) -> OperationListCall<'a, C, A> { + OperationListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *manifest* resources. +/// It is not used directly, but through the `DeploymentManager` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use deploymentmanager2_beta2::DeploymentManager; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = DeploymentManager::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.manifests(); +/// # } +/// ``` +pub struct ManifestMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, +} + +impl<'a, C, A> MethodsBuilder for ManifestMethods<'a, C, A> {} + +impl<'a, C, A> ManifestMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists all manifests for a given deployment. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + /// * `deployment` - The name of the deployment for this request. + pub fn list(&self, project: &str, deployment: &str) -> ManifestListCall<'a, C, A> { + ManifestListCall { + hub: self.hub, + _project: project.to_string(), + _deployment: deployment.to_string(), + _page_token: Default::default(), + _max_results: 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: + /// + /// Gets information about a specific manifest. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + /// * `deployment` - The name of the deployment for this request. + /// * `manifest` - The name of the manifest for this request. + pub fn get(&self, project: &str, deployment: &str, manifest: &str) -> ManifestGetCall<'a, C, A> { + ManifestGetCall { + hub: self.hub, + _project: project.to_string(), + _deployment: deployment.to_string(), + _manifest: manifest.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *resource* resources. +/// It is not used directly, but through the `DeploymentManager` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use deploymentmanager2_beta2::DeploymentManager; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = DeploymentManager::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.resources(); +/// # } +/// ``` +pub struct ResourceMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, +} + +impl<'a, C, A> MethodsBuilder for ResourceMethods<'a, C, A> {} + +impl<'a, C, A> ResourceMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets information about a single resource. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + /// * `deployment` - The name of the deployment for this request. + /// * `resource` - The name of the resource for this request. + pub fn get(&self, project: &str, deployment: &str, resource: &str) -> ResourceGetCall<'a, C, A> { + ResourceGetCall { + hub: self.hub, + _project: project.to_string(), + _deployment: deployment.to_string(), + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all resources in a given deployment. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + /// * `deployment` - The name of the deployment for this request. + pub fn list(&self, project: &str, deployment: &str) -> ResourceListCall<'a, C, A> { + ResourceListCall { + hub: self.hub, + _project: project.to_string(), + _deployment: deployment.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *type* resources. +/// It is not used directly, but through the `DeploymentManager` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use deploymentmanager2_beta2::DeploymentManager; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = DeploymentManager::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `list(...)` +/// // to build up your call. +/// let rb = hub.types(); +/// # } +/// ``` +pub struct TypeMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, +} + +impl<'a, C, A> MethodsBuilder for TypeMethods<'a, C, A> {} + +impl<'a, C, A> TypeMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists all resource types for Deployment Manager. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + pub fn list(&self, project: &str) -> TypeListCall<'a, C, A> { + TypeListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *deployment* resources. +/// It is not used directly, but through the `DeploymentManager` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use deploymentmanager2_beta2::DeploymentManager; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = DeploymentManager::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.deployments(); +/// # } +/// ``` +pub struct DeploymentMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, +} + +impl<'a, C, A> MethodsBuilder for DeploymentMethods<'a, C, A> {} + +impl<'a, C, A> DeploymentMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates a deployment and all of the resources described by the deployment manifest. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + /// * `deployment` - The name of the deployment for this request. + pub fn update(&self, request: Deployment, project: &str, deployment: &str) -> DeploymentUpdateCall<'a, C, A> { + DeploymentUpdateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _deployment: deployment.to_string(), + _update_policy: Default::default(), + _delete_policy: Default::default(), + _create_policy: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets information about a specific deployment. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + /// * `deployment` - The name of the deployment for this request. + pub fn get(&self, project: &str, deployment: &str) -> DeploymentGetCall<'a, C, A> { + DeploymentGetCall { + hub: self.hub, + _project: project.to_string(), + _deployment: deployment.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a deployment and all of the resources described by the deployment manifest. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + pub fn insert(&self, request: Deployment, project: &str) -> DeploymentInsertCall<'a, C, A> { + DeploymentInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all deployments for a given project. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + pub fn list(&self, project: &str) -> DeploymentListCall<'a, C, A> { + DeploymentListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _max_results: 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: + /// + /// Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + /// * `deployment` - The name of the deployment for this request. + pub fn patch(&self, request: Deployment, project: &str, deployment: &str) -> DeploymentPatchCall<'a, C, A> { + DeploymentPatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _deployment: deployment.to_string(), + _update_policy: Default::default(), + _delete_policy: Default::default(), + _create_policy: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a deployment and all of the resources in the deployment. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + /// * `deployment` - The name of the deployment for this request. + pub fn delete(&self, project: &str, deployment: &str) -> DeploymentDeleteCall<'a, C, A> { + DeploymentDeleteCall { + hub: self.hub, + _project: project.to_string(), + _deployment: deployment.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Gets information about a specific operation. +/// +/// 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_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use deploymentmanager2_beta2::DeploymentManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = DeploymentManager::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("project", "operation") +/// .doit(); +/// # } +/// ``` +pub struct OperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, + _project: String, + _operation: 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 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: "deploymentmanager.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("operation", self._operation.to_string())); + for &field in ["alt", "project", "operation"].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://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/operations/{operation}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{operation}", "operation")].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(2); + for param_name in ["operation", "project"].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 project ID for this request. + /// + /// Sets the *project* 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 project(mut self, new_value: &str) -> OperationGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the operation for this request. + /// + /// Sets the *operation* 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 operation(mut self, new_value: &str) -> OperationGetCall<'a, C, A> { + self._operation = 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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + 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::NdevCloudmanReadonly`. + /// + /// 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 all operations for a project. +/// +/// 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_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use deploymentmanager2_beta2::DeploymentManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = DeploymentManager::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("project") +/// .page_token("sea") +/// .max_results(11) +/// .filter("dolores") +/// .doit(); +/// # } +/// ``` +pub struct OperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, + _project: String, + _page_token: Option, + _max_results: 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, OperationsListResponse)> { + 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: "deploymentmanager.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults", "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://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/operations".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].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 ["project"].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 project ID for this request. + /// + /// Sets the *project* 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 project(mut self, new_value: &str) -> OperationListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// + /// 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 + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> OperationListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Filter expression for filtering listed resources. + /// + /// 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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + 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::NdevCloudmanReadonly`. + /// + /// 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 + } +} + + +/// Lists all manifests for a given deployment. +/// +/// A builder for the *list* method supported by a *manifest* resource. +/// It is not used directly, but through a `ManifestMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use deploymentmanager2_beta2::DeploymentManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = DeploymentManager::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.manifests().list("project", "deployment") +/// .page_token("aliquyam") +/// .max_results(35) +/// .filter("no") +/// .doit(); +/// # } +/// ``` +pub struct ManifestListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, + _project: String, + _deployment: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ManifestListCall<'a, C, A> {} + +impl<'a, C, A> ManifestListCall<'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, ManifestsListResponse)> { + 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: "deploymentmanager.manifests.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("deployment", self._deployment.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "deployment", "pageToken", "maxResults", "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://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}/manifests".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{deployment}", "deployment")].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(2); + for param_name in ["deployment", "project"].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 project ID for this request. + /// + /// Sets the *project* 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 project(mut self, new_value: &str) -> ManifestListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the deployment for this request. + /// + /// Sets the *deployment* 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 deployment(mut self, new_value: &str) -> ManifestListCall<'a, C, A> { + self._deployment = new_value.to_string(); + self + } + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ManifestListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ManifestListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Filter expression for filtering listed resources. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ManifestListCall<'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) -> ManifestListCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ManifestListCall<'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::NdevCloudmanReadonly`. + /// + /// 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) -> ManifestListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets information about a specific manifest. +/// +/// A builder for the *get* method supported by a *manifest* resource. +/// It is not used directly, but through a `ManifestMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use deploymentmanager2_beta2::DeploymentManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = DeploymentManager::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.manifests().get("project", "deployment", "manifest") +/// .doit(); +/// # } +/// ``` +pub struct ManifestGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, + _project: String, + _deployment: String, + _manifest: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ManifestGetCall<'a, C, A> {} + +impl<'a, C, A> ManifestGetCall<'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, Manifest)> { + 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: "deploymentmanager.manifests.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("deployment", self._deployment.to_string())); + params.push(("manifest", self._manifest.to_string())); + for &field in ["alt", "project", "deployment", "manifest"].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://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}/manifests/{manifest}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{deployment}", "deployment"), ("{manifest}", "manifest")].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(3); + for param_name in ["manifest", "deployment", "project"].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 project ID for this request. + /// + /// Sets the *project* 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 project(mut self, new_value: &str) -> ManifestGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the deployment for this request. + /// + /// Sets the *deployment* 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 deployment(mut self, new_value: &str) -> ManifestGetCall<'a, C, A> { + self._deployment = new_value.to_string(); + self + } + /// The name of the manifest for this request. + /// + /// Sets the *manifest* 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 manifest(mut self, new_value: &str) -> ManifestGetCall<'a, C, A> { + self._manifest = 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) -> ManifestGetCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ManifestGetCall<'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::NdevCloudmanReadonly`. + /// + /// 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) -> ManifestGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets information about a single resource. +/// +/// A builder for the *get* method supported by a *resource* resource. +/// It is not used directly, but through a `ResourceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use deploymentmanager2_beta2::DeploymentManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = DeploymentManager::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.resources().get("project", "deployment", "resource") +/// .doit(); +/// # } +/// ``` +pub struct ResourceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, + _project: String, + _deployment: String, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ResourceGetCall<'a, C, A> {} + +impl<'a, C, A> ResourceGetCall<'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, ResourceType)> { + 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: "deploymentmanager.resources.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("deployment", self._deployment.to_string())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "project", "deployment", "resource"].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://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}/resources/{resource}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{deployment}", "deployment"), ("{resource}", "resource")].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(3); + for param_name in ["resource", "deployment", "project"].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 project ID for this request. + /// + /// Sets the *project* 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 project(mut self, new_value: &str) -> ResourceGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the deployment for this request. + /// + /// Sets the *deployment* 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 deployment(mut self, new_value: &str) -> ResourceGetCall<'a, C, A> { + self._deployment = new_value.to_string(); + self + } + /// The name of the resource for this request. + /// + /// Sets the *resource* 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 resource(mut self, new_value: &str) -> ResourceGetCall<'a, C, A> { + self._resource = 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) -> ResourceGetCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ResourceGetCall<'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::NdevCloudmanReadonly`. + /// + /// 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) -> ResourceGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists all resources in a given deployment. +/// +/// A builder for the *list* method supported by a *resource* resource. +/// It is not used directly, but through a `ResourceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use deploymentmanager2_beta2::DeploymentManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = DeploymentManager::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.resources().list("project", "deployment") +/// .page_token("duo") +/// .max_results(69) +/// .filter("sea") +/// .doit(); +/// # } +/// ``` +pub struct ResourceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, + _project: String, + _deployment: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ResourceListCall<'a, C, A> {} + +impl<'a, C, A> ResourceListCall<'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, ResourcesListResponse)> { + 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: "deploymentmanager.resources.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("deployment", self._deployment.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "deployment", "pageToken", "maxResults", "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://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}/resources".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{deployment}", "deployment")].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(2); + for param_name in ["deployment", "project"].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 project ID for this request. + /// + /// Sets the *project* 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 project(mut self, new_value: &str) -> ResourceListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the deployment for this request. + /// + /// Sets the *deployment* 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 deployment(mut self, new_value: &str) -> ResourceListCall<'a, C, A> { + self._deployment = new_value.to_string(); + self + } + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ResourceListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ResourceListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Filter expression for filtering listed resources. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ResourceListCall<'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) -> ResourceListCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ResourceListCall<'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::NdevCloudmanReadonly`. + /// + /// 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) -> ResourceListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists all resource types for Deployment Manager. +/// +/// A builder for the *list* method supported by a *type* resource. +/// It is not used directly, but through a `TypeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use deploymentmanager2_beta2::DeploymentManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = DeploymentManager::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.types().list("project") +/// .page_token("eos") +/// .max_results(20) +/// .filter("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct TypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, + _project: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TypeListCall<'a, C, A> {} + +impl<'a, C, A> TypeListCall<'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, TypesListResponse)> { + 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: "deploymentmanager.types.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults", "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://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/types".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].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 ["project"].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 project ID for this request. + /// + /// Sets the *project* 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 project(mut self, new_value: &str) -> TypeListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> TypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> TypeListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Filter expression for filtering listed resources. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> TypeListCall<'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) -> TypeListCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TypeListCall<'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::NdevCloudmanReadonly`. + /// + /// 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) -> TypeListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates a deployment and all of the resources described by the deployment manifest. +/// +/// A builder for the *update* method supported by a *deployment* resource. +/// It is not used directly, but through a `DeploymentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// use deploymentmanager2_beta2::Deployment; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use deploymentmanager2_beta2::DeploymentManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = DeploymentManager::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 = Deployment::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.deployments().update(req, "project", "deployment") +/// .update_policy("elitr") +/// .delete_policy("amet") +/// .create_policy("no") +/// .doit(); +/// # } +/// ``` +pub struct DeploymentUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, + _request: Deployment, + _project: String, + _deployment: String, + _update_policy: Option, + _delete_policy: Option, + _create_policy: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DeploymentUpdateCall<'a, C, A> {} + +impl<'a, C, A> DeploymentUpdateCall<'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: "deploymentmanager.deployments.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("deployment", self._deployment.to_string())); + if let Some(value) = self._update_policy { + params.push(("updatePolicy", value.to_string())); + } + if let Some(value) = self._delete_policy { + params.push(("deletePolicy", value.to_string())); + } + if let Some(value) = self._create_policy { + params.push(("createPolicy", value.to_string())); + } + for &field in ["alt", "project", "deployment", "updatePolicy", "deletePolicy", "createPolicy"].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://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{deployment}", "deployment")].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(2); + for param_name in ["deployment", "project"].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::Put, &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: Deployment) -> DeploymentUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* 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 project(mut self, new_value: &str) -> DeploymentUpdateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the deployment for this request. + /// + /// Sets the *deployment* 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 deployment(mut self, new_value: &str) -> DeploymentUpdateCall<'a, C, A> { + self._deployment = new_value.to_string(); + self + } + /// Sets the policy to use for updating resources. + /// + /// Sets the *update policy* query property to the given value. + pub fn update_policy(mut self, new_value: &str) -> DeploymentUpdateCall<'a, C, A> { + self._update_policy = Some(new_value.to_string()); + self + } + /// Sets the policy to use for deleting resources. + /// + /// Sets the *delete policy* query property to the given value. + pub fn delete_policy(mut self, new_value: &str) -> DeploymentUpdateCall<'a, C, A> { + self._delete_policy = Some(new_value.to_string()); + self + } + /// Sets the policy to use for creating new resources. + /// + /// Sets the *create policy* query property to the given value. + pub fn create_policy(mut self, new_value: &str) -> DeploymentUpdateCall<'a, C, A> { + self._create_policy = 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) -> DeploymentUpdateCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DeploymentUpdateCall<'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) -> DeploymentUpdateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets information about a specific deployment. +/// +/// A builder for the *get* method supported by a *deployment* resource. +/// It is not used directly, but through a `DeploymentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use deploymentmanager2_beta2::DeploymentManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = DeploymentManager::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.deployments().get("project", "deployment") +/// .doit(); +/// # } +/// ``` +pub struct DeploymentGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, + _project: String, + _deployment: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DeploymentGetCall<'a, C, A> {} + +impl<'a, C, A> DeploymentGetCall<'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, Deployment)> { + 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: "deploymentmanager.deployments.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("deployment", self._deployment.to_string())); + for &field in ["alt", "project", "deployment"].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://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{deployment}", "deployment")].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(2); + for param_name in ["deployment", "project"].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 project ID for this request. + /// + /// Sets the *project* 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 project(mut self, new_value: &str) -> DeploymentGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the deployment for this request. + /// + /// Sets the *deployment* 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 deployment(mut self, new_value: &str) -> DeploymentGetCall<'a, C, A> { + self._deployment = 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) -> DeploymentGetCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DeploymentGetCall<'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::NdevCloudmanReadonly`. + /// + /// 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) -> DeploymentGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates a deployment and all of the resources described by the deployment manifest. +/// +/// A builder for the *insert* method supported by a *deployment* resource. +/// It is not used directly, but through a `DeploymentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// use deploymentmanager2_beta2::Deployment; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use deploymentmanager2_beta2::DeploymentManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = DeploymentManager::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 = Deployment::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.deployments().insert(req, "project") +/// .doit(); +/// # } +/// ``` +pub struct DeploymentInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, + _request: Deployment, + _project: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DeploymentInsertCall<'a, C, A> {} + +impl<'a, C, A> DeploymentInsertCall<'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: "deploymentmanager.deployments.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + for &field in ["alt", "project"].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://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].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 ["project"].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: Deployment) -> DeploymentInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* 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 project(mut self, new_value: &str) -> DeploymentInsertCall<'a, C, A> { + self._project = 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) -> DeploymentInsertCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DeploymentInsertCall<'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) -> DeploymentInsertCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists all deployments for a given project. +/// +/// A builder for the *list* method supported by a *deployment* resource. +/// It is not used directly, but through a `DeploymentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use deploymentmanager2_beta2::DeploymentManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = DeploymentManager::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.deployments().list("project") +/// .page_token("aliquyam") +/// .max_results(28) +/// .filter("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct DeploymentListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, + _project: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DeploymentListCall<'a, C, A> {} + +impl<'a, C, A> DeploymentListCall<'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, DeploymentsListResponse)> { + 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: "deploymentmanager.deployments.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults", "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://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].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 ["project"].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 project ID for this request. + /// + /// Sets the *project* 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 project(mut self, new_value: &str) -> DeploymentListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> DeploymentListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> DeploymentListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Filter expression for filtering listed resources. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> DeploymentListCall<'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) -> DeploymentListCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DeploymentListCall<'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::NdevCloudmanReadonly`. + /// + /// 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) -> DeploymentListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *deployment* resource. +/// It is not used directly, but through a `DeploymentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// use deploymentmanager2_beta2::Deployment; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use deploymentmanager2_beta2::DeploymentManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = DeploymentManager::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 = Deployment::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.deployments().patch(req, "project", "deployment") +/// .update_policy("duo") +/// .delete_policy("et") +/// .create_policy("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct DeploymentPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, + _request: Deployment, + _project: String, + _deployment: String, + _update_policy: Option, + _delete_policy: Option, + _create_policy: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DeploymentPatchCall<'a, C, A> {} + +impl<'a, C, A> DeploymentPatchCall<'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: "deploymentmanager.deployments.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("deployment", self._deployment.to_string())); + if let Some(value) = self._update_policy { + params.push(("updatePolicy", value.to_string())); + } + if let Some(value) = self._delete_policy { + params.push(("deletePolicy", value.to_string())); + } + if let Some(value) = self._create_policy { + params.push(("createPolicy", value.to_string())); + } + for &field in ["alt", "project", "deployment", "updatePolicy", "deletePolicy", "createPolicy"].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://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{deployment}", "deployment")].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(2); + for param_name in ["deployment", "project"].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: Deployment) -> DeploymentPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* 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 project(mut self, new_value: &str) -> DeploymentPatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the deployment for this request. + /// + /// Sets the *deployment* 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 deployment(mut self, new_value: &str) -> DeploymentPatchCall<'a, C, A> { + self._deployment = new_value.to_string(); + self + } + /// Sets the policy to use for updating resources. + /// + /// Sets the *update policy* query property to the given value. + pub fn update_policy(mut self, new_value: &str) -> DeploymentPatchCall<'a, C, A> { + self._update_policy = Some(new_value.to_string()); + self + } + /// Sets the policy to use for deleting resources. + /// + /// Sets the *delete policy* query property to the given value. + pub fn delete_policy(mut self, new_value: &str) -> DeploymentPatchCall<'a, C, A> { + self._delete_policy = Some(new_value.to_string()); + self + } + /// Sets the policy to use for creating new resources. + /// + /// Sets the *create policy* query property to the given value. + pub fn create_policy(mut self, new_value: &str) -> DeploymentPatchCall<'a, C, A> { + self._create_policy = 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) -> DeploymentPatchCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DeploymentPatchCall<'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) -> DeploymentPatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Deletes a deployment and all of the resources in the deployment. +/// +/// A builder for the *delete* method supported by a *deployment* resource. +/// It is not used directly, but through a `DeploymentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_deploymentmanager2_beta2 as deploymentmanager2_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use deploymentmanager2_beta2::DeploymentManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = DeploymentManager::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.deployments().delete("project", "deployment") +/// .doit(); +/// # } +/// ``` +pub struct DeploymentDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DeploymentManager, + _project: String, + _deployment: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DeploymentDeleteCall<'a, C, A> {} + +impl<'a, C, A> DeploymentDeleteCall<'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: "deploymentmanager.deployments.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("deployment", self._deployment.to_string())); + for &field in ["alt", "project", "deployment"].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://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{deployment}", "deployment")].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(2); + for param_name in ["deployment", "project"].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 project ID for this request. + /// + /// Sets the *project* 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 project(mut self, new_value: &str) -> DeploymentDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the deployment for this request. + /// + /// Sets the *deployment* 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 deployment(mut self, new_value: &str) -> DeploymentDeleteCall<'a, C, A> { + self._deployment = 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) -> DeploymentDeleteCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DeploymentDeleteCall<'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) -> DeploymentDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + diff --git a/gen/dfareporting2d1-cli/Cargo.toml b/gen/dfareporting2d1-cli/Cargo.toml index 4c10c67dc9..7e692b6c8d 100644 --- a/gen/dfareporting2d1-cli/Cargo.toml +++ b/gen/dfareporting2d1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["dfareporting", "google", "cli"] name = "dfareporting2d1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/dfareporting2d1-cli/src/main.rs b/gen/dfareporting2d1-cli/src/main.rs index 7c68b35ba3..080ef27c1f 100644 --- a/gen/dfareporting2d1-cli/src/main.rs +++ b/gen/dfareporting2d1-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -140,6 +141,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -191,6 +193,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -242,6 +245,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -293,6 +297,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -344,6 +349,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -451,6 +457,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -530,6 +537,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -637,6 +645,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -744,6 +753,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -795,6 +805,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -868,6 +879,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -973,6 +985,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1078,6 +1091,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1129,6 +1143,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1276,6 +1291,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1400,6 +1416,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1547,6 +1564,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1694,6 +1712,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1789,6 +1808,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1876,6 +1896,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1946,6 +1967,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2033,6 +2055,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2120,6 +2143,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2171,6 +2195,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2278,6 +2303,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2366,6 +2392,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2473,6 +2500,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2580,6 +2608,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2631,6 +2660,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2716,6 +2746,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2777,6 +2808,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2828,6 +2860,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2951,6 +2984,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3042,6 +3076,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3165,6 +3200,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3288,6 +3324,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3339,6 +3376,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3421,6 +3459,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3485,6 +3524,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3536,6 +3576,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3587,6 +3628,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3682,6 +3724,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3769,6 +3812,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3839,6 +3883,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3926,6 +3971,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4013,6 +4059,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4064,6 +4111,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4115,6 +4163,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4207,6 +4256,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4302,6 +4352,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4388,6 +4439,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4458,6 +4510,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4544,6 +4597,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4630,6 +4684,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4725,6 +4780,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4820,6 +4876,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4893,6 +4950,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4988,6 +5046,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5083,6 +5142,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5134,6 +5194,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5230,6 +5291,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5306,6 +5368,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5402,6 +5465,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5498,6 +5562,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5549,6 +5614,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5700,6 +5766,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5800,6 +5867,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5951,6 +6019,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6102,6 +6171,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6196,6 +6266,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6247,6 +6318,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6320,6 +6392,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6371,6 +6444,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6482,6 +6556,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6573,6 +6648,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6668,6 +6744,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6778,6 +6855,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6860,6 +6938,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -6970,6 +7049,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7080,6 +7160,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7136,8 +7217,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -7206,6 +7289,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7305,6 +7389,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7356,6 +7441,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7480,6 +7566,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7571,6 +7658,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7695,6 +7783,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7819,6 +7908,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -7914,6 +8004,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8024,6 +8115,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8103,6 +8195,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8213,6 +8306,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8323,6 +8417,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8374,6 +8469,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8429,6 +8525,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8541,6 +8638,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8653,6 +8751,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8704,6 +8803,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8780,6 +8880,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8875,6 +8976,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -8963,6 +9065,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9014,6 +9117,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9102,6 +9206,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9190,6 +9295,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9241,6 +9347,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9292,6 +9399,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9343,6 +9451,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9394,6 +9503,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9445,6 +9555,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9496,6 +9607,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9547,6 +9659,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9598,6 +9711,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9677,6 +9791,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9728,6 +9843,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9801,6 +9917,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -9852,6 +9969,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -10004,6 +10122,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -10101,6 +10220,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -10253,6 +10373,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -10405,6 +10526,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -10500,6 +10622,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -10587,6 +10710,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -10657,6 +10781,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -10744,6 +10869,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -10831,6 +10957,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -10892,6 +11019,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -10943,6 +11071,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -11107,6 +11236,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -11213,6 +11343,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -11377,6 +11508,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -11541,6 +11673,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -11592,6 +11725,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -11643,6 +11777,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -11694,6 +11829,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -11745,6 +11881,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -11796,6 +11933,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -11869,6 +12007,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -11920,6 +12059,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -11971,6 +12111,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -12058,6 +12199,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -12145,6 +12287,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -12196,6 +12339,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -12298,6 +12442,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -12371,6 +12516,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -12473,6 +12619,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -12575,6 +12722,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -12739,6 +12887,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -12839,8 +12988,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -12906,6 +13057,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -12957,6 +13109,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -13121,6 +13274,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -13188,6 +13342,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -13352,6 +13507,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -13407,6 +13563,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -13571,6 +13728,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -13622,6 +13780,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -13736,6 +13895,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -13833,6 +13993,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -13947,6 +14108,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14061,6 +14223,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14112,6 +14275,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14200,6 +14364,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14264,6 +14429,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14315,6 +14481,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14403,6 +14570,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14473,6 +14641,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14561,6 +14730,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14649,6 +14819,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14700,6 +14871,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14770,6 +14942,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14821,6 +14994,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14872,6 +15046,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14923,6 +15098,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -14974,6 +15150,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -15025,6 +15202,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -15080,6 +15258,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -15175,6 +15354,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -15265,6 +15445,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -15341,6 +15522,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -15431,6 +15613,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -15521,6 +15704,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -16585,7 +16769,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() @@ -16598,7 +16782,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() diff --git a/gen/dfareporting2d1/Cargo.toml b/gen/dfareporting2d1/Cargo.toml index 977fbec0e6..70041efb54 100644 --- a/gen/dfareporting2d1/Cargo.toml +++ b/gen/dfareporting2d1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/dfareporting2d1/src/cmn.rs b/gen/dfareporting2d1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/dfareporting2d1/src/cmn.rs +++ b/gen/dfareporting2d1/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/discovery1-cli/Cargo.toml b/gen/discovery1-cli/Cargo.toml index d6973ad1a1..38789df5b4 100644 --- a/gen/discovery1-cli/Cargo.toml +++ b/gen/discovery1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["discovery", "google", "cli"] name = "discovery1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/discovery1-cli/src/main.rs b/gen/discovery1-cli/src/main.rs index 81b120833c..604f9abbf4 100644 --- a/gen/discovery1-cli/src/main.rs +++ b/gen/discovery1-cli/src/main.rs @@ -86,6 +86,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -141,6 +142,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -200,7 +202,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() @@ -213,7 +215,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() diff --git a/gen/discovery1/Cargo.toml b/gen/discovery1/Cargo.toml index 9861381908..93e534c8a2 100644 --- a/gen/discovery1/Cargo.toml +++ b/gen/discovery1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/discovery1/src/cmn.rs b/gen/discovery1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/discovery1/src/cmn.rs +++ b/gen/discovery1/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/dns1-cli/Cargo.toml b/gen/dns1-cli/Cargo.toml index e2fe0b0536..203189b7d9 100644 --- a/gen/dns1-cli/Cargo.toml +++ b/gen/dns1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["dns", "google", "cli"] name = "dns1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/dns1-cli/src/main.rs b/gen/dns1-cli/src/main.rs index 4d59584c18..98122292c1 100644 --- a/gen/dns1-cli/src/main.rs +++ b/gen/dns1-cli/src/main.rs @@ -125,6 +125,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -176,6 +177,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -240,6 +242,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -331,6 +334,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -426,6 +430,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -484,6 +489,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -535,6 +541,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -599,6 +606,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -703,7 +711,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() @@ -716,7 +724,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() diff --git a/gen/dns1/Cargo.toml b/gen/dns1/Cargo.toml index 9f21703a42..b22a910dc9 100644 --- a/gen/dns1/Cargo.toml +++ b/gen/dns1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/dns1/src/cmn.rs b/gen/dns1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/dns1/src/cmn.rs +++ b/gen/dns1/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/doubleclickbidmanager1-cli/Cargo.toml b/gen/doubleclickbidmanager1-cli/Cargo.toml index 0547e5d867..aaec4f5975 100644 --- a/gen/doubleclickbidmanager1-cli/Cargo.toml +++ b/gen/doubleclickbidmanager1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["doubleclickbidmanage", "google", "cli"] name = "doubleclickbidmanager1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/doubleclickbidmanager1-cli/src/main.rs b/gen/doubleclickbidmanager1-cli/src/main.rs index ae4f14d436..236266aa2a 100644 --- a/gen/doubleclickbidmanager1-cli/src/main.rs +++ b/gen/doubleclickbidmanager1-cli/src/main.rs @@ -121,6 +121,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -204,6 +205,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -308,6 +310,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -397,6 +400,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -445,6 +449,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -570,6 +575,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -663,7 +669,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() @@ -676,7 +682,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() diff --git a/gen/doubleclickbidmanager1/Cargo.toml b/gen/doubleclickbidmanager1/Cargo.toml index d6dea779ae..81f5641fb3 100644 --- a/gen/doubleclickbidmanager1/Cargo.toml +++ b/gen/doubleclickbidmanager1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/doubleclickbidmanager1/src/cmn.rs b/gen/doubleclickbidmanager1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/doubleclickbidmanager1/src/cmn.rs +++ b/gen/doubleclickbidmanager1/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/doubleclicksearch2-cli/Cargo.toml b/gen/doubleclicksearch2-cli/Cargo.toml index d16e1fdb3f..ee7255becc 100644 --- a/gen/doubleclicksearch2-cli/Cargo.toml +++ b/gen/doubleclicksearch2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-doubleclicksearch2-cli" -version = "0.3.0+20150303" +version = "0.3.0+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with doubleclicksearch (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclicksearch2-cli" @@ -17,8 +17,8 @@ keywords = ["doubleclicksearch", "google", "cli"] name = "doubleclicksearch2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/doubleclicksearch2-cli/README.md b/gen/doubleclicksearch2-cli/README.md index 3187eec3a0..8f3b666628 100644 --- a/gen/doubleclicksearch2-cli/README.md +++ b/gen/doubleclicksearch2-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *doubleclicksearch* API at revision *20150303*. The CLI is at version *0.3.0*. +This documentation was generated from the *doubleclicksearch* API at revision *20150526*. The CLI is at version *0.3.0*. ```bash doubleclicksearch2 [options] diff --git a/gen/doubleclicksearch2-cli/mkdocs.yml b/gen/doubleclicksearch2-cli/mkdocs.yml index af66e9c2a0..d13b52d7d6 100644 --- a/gen/doubleclicksearch2-cli/mkdocs.yml +++ b/gen/doubleclicksearch2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: doubleclicksearch v0.3.0+20150303 +site_name: doubleclicksearch v0.3.0+20150526 site_url: http://byron.github.io/google-apis-rs/google-doubleclicksearch2-cli site_description: Write integrating applications with bcore diff --git a/gen/doubleclicksearch2-cli/src/main.rs b/gen/doubleclicksearch2-cli/src/main.rs index d821acf691..9450ce1ef9 100644 --- a/gen/doubleclicksearch2-cli/src/main.rs +++ b/gen/doubleclicksearch2-cli/src/main.rs @@ -106,6 +106,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -190,6 +191,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -278,6 +280,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -362,6 +365,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -445,6 +449,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -548,6 +553,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -599,6 +605,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -655,6 +662,7 @@ impl<'n, 'a> Engine<'n, 'a> { if !download_mode { } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -759,6 +767,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -810,6 +819,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -909,7 +919,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() @@ -922,7 +932,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() @@ -1280,7 +1290,7 @@ fn main() { let mut app = App::new("doubleclicksearch2") .author("Sebastian Thiel ") - .version("0.3.0+20150303") + .version("0.3.0+20150526") .about("Report and modify your advertising data in DoubleClick Search (for example, campaigns, ad groups, keywords, and conversions).") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_doubleclicksearch2_cli") .arg(Arg::with_name("url") diff --git a/gen/doubleclicksearch2/Cargo.toml b/gen/doubleclicksearch2/Cargo.toml index 2d54e5ba8c..b768766c47 100644 --- a/gen/doubleclicksearch2/Cargo.toml +++ b/gen/doubleclicksearch2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-doubleclicksearch2" -version = "0.1.8+20150303" +version = "0.1.8+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with doubleclicksearch (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclicksearch2" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/doubleclicksearch2/README.md b/gen/doubleclicksearch2/README.md index 7863f90e99..1c49d17166 100644 --- a/gen/doubleclicksearch2/README.md +++ b/gen/doubleclicksearch2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-doubleclicksearch2` library allows access to all features of the *Google doubleclicksearch* service. -This documentation was generated from *doubleclicksearch* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *doubleclicksearch* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *doubleclicksearch* *v2* API can be found at the [official documentation site](https://developers.google.com/doubleclick-search/). diff --git a/gen/doubleclicksearch2/src/cmn.rs b/gen/doubleclicksearch2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/doubleclicksearch2/src/cmn.rs +++ b/gen/doubleclicksearch2/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/doubleclicksearch2/src/lib.rs b/gen/doubleclicksearch2/src/lib.rs index 324e99e4ac..e7b708dcab 100644 --- a/gen/doubleclicksearch2/src/lib.rs +++ b/gen/doubleclicksearch2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *doubleclicksearch* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *doubleclicksearch* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *doubleclicksearch* *v2* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-search/). diff --git a/gen/doubleclicksearch2/src/lib.rs.in b/gen/doubleclicksearch2/src/lib.rs.in index 844acfd08f..2123ab5e81 100644 --- a/gen/doubleclicksearch2/src/lib.rs.in +++ b/gen/doubleclicksearch2/src/lib.rs.in @@ -196,12 +196,9 @@ pub struct Conversion { /// DS ad group ID. #[serde(rename="adGroupId")] pub ad_group_id: Option, - /// The numeric segmentation identifier (for example, DoubleClick Search Floodlight activity ID). - #[serde(rename="segmentationId")] - pub segmentation_id: Option, - /// Attribution model name. This field is ignored. - #[serde(rename="attributionModel")] - pub attribution_model: Option, + /// ID that DoubleClick Search generates for each conversion. + #[serde(rename="dsConversionId")] + pub ds_conversion_id: Option, /// DS campaign ID. #[serde(rename="campaignId")] pub campaign_id: Option, @@ -211,59 +208,87 @@ pub struct Conversion { /// DS advertiser ID. #[serde(rename="advertiserId")] pub advertiser_id: Option, - /// The quantity of this conversion, in millis. - #[serde(rename="quantityMillis")] - pub quantity_millis: Option, - /// The number of conversions, formatted in millis (conversions multiplied by 1000). This field is ignored. + /// This field is ignored. #[serde(rename="countMillis")] pub count_millis: Option, - /// DS criterion (keyword) ID. - #[serde(rename="criterionId")] - pub criterion_id: Option, /// The time at which the conversion took place, in epoch millis UTC. #[serde(rename="conversionTimestamp")] pub conversion_timestamp: Option, - /// The advertiser-provided order id for the conversion. + /// DS click ID for the conversion. + #[serde(rename="clickId")] + pub click_id: Option, + /// This field is ignored. + #[serde(rename="attributionModel")] + pub attribution_model: Option, + /// The currency code for the conversion's revenue. Should be in ISO 4217 alphabetic (3-char) format. + #[serde(rename="currencyCode")] + pub currency_code: Option, + /// The country registered for the Merchant Center feed that contains the product. Use an ISO 3166 code to specify a country. + #[serde(rename="productCountry")] + pub product_country: Option, + /// The state of the conversion, that is, either ACTIVE or REMOVED. Note: state DELETED is deprecated. + pub state: Option, + /// The type of device on which the conversion occurred. + #[serde(rename="deviceType")] + pub device_type: Option, + /// DS ad ID. + #[serde(rename="adId")] + pub ad_id: Option, + /// For offline conversions, this is an ID provided by advertisers. Advertisers can use this property to specify an ID that is meaningful to them. If an advertiser doesn't specify a conversionId, DoubleClick Search generates one. For online conversions, DS copies the dsConversionId or floodlightOrderId into this property depending on the advertiser's Floodlight instructions. + #[serde(rename="conversionId")] + pub conversion_id: Option, + /// The time at which the conversion was last modified, in epoch millis UTC. + #[serde(rename="conversionModifiedTimestamp")] + pub conversion_modified_timestamp: Option, + /// Sales channel for the product. Acceptable values are: + /// - "local": a physical store + /// - "online": an online store + pub channel: Option, + /// The product ID (SKU). + #[serde(rename="productId")] + pub product_id: Option, + /// The numeric segmentation identifier (for example, DoubleClick Search Floodlight activity ID). + #[serde(rename="segmentationId")] + pub segmentation_id: Option, + /// DS agency ID. + #[serde(rename="agencyId")] + pub agency_id: Option, + /// The ID of the local store for which the product was advertised. Applicable only when the channel is "local". + #[serde(rename="storeId")] + pub store_id: Option, + /// The quantity of this conversion, in millis. + #[serde(rename="quantityMillis")] + pub quantity_millis: Option, + /// DS criterion (keyword) ID. + #[serde(rename="criterionId")] + pub criterion_id: Option, + /// The Floodlight order ID provided by the advertiser for the conversion. #[serde(rename="floodlightOrderId")] pub floodlight_order_id: Option, /// The segmentation type of this conversion (for example, FLOODLIGHT). #[serde(rename="segmentationType")] pub segmentation_type: Option, - /// DS click ID for the conversion. - #[serde(rename="clickId")] - pub click_id: Option, /// Custom metrics for the conversion. #[serde(rename="customMetric")] pub custom_metric: Option>, - /// DS conversion ID. - #[serde(rename="dsConversionId")] - pub ds_conversion_id: Option, - /// DS engine account ID. - #[serde(rename="engineAccountId")] - pub engine_account_id: Option, - /// The time at which the conversion was last modified, in epoch millis UTC. - #[serde(rename="conversionModifiedTimestamp")] - pub conversion_modified_timestamp: Option, - /// The currency code for the conversion's revenue. Should be in ISO 4217 alphabetic (3-char) format. - #[serde(rename="currencyCode")] - pub currency_code: Option, - /// The friendly segmentation identifier (for example, DoubleClick Search Floodlight activity name). - #[serde(rename="segmentationName")] - pub segmentation_name: Option, - /// The state of the conversion, that is, either ACTIVE or REMOVED. Note: state DELETED is deprecated. - pub state: Option, - /// DS ad ID. - #[serde(rename="adId")] - pub ad_id: Option, - /// DS agency ID. - #[serde(rename="agencyId")] - pub agency_id: Option, - /// Advertiser-provided ID for the conversion, also known as the order ID. - #[serde(rename="conversionId")] - pub conversion_id: Option, + /// DS product group ID. + #[serde(rename="productGroupId")] + pub product_group_id: Option, /// The type of the conversion, that is, either ACTION or TRANSACTION. An ACTION conversion is an action by the user that has no monetarily quantifiable value, while a TRANSACTION conversion is an action that does have a monetarily quantifiable value. Examples are email list signups (ACTION) versus ecommerce purchases (TRANSACTION). #[serde(rename="type")] pub type_: Option, + /// The friendly segmentation identifier (for example, DoubleClick Search Floodlight activity name). + #[serde(rename="segmentationName")] + pub segmentation_name: Option, + /// ID that DS generates and uses to uniquely identify the inventory account that contains the product. + #[serde(rename="inventoryAccountId")] + pub inventory_account_id: Option, + /// DS engine account ID. + #[serde(rename="engineAccountId")] + pub engine_account_id: Option, + /// The language registered for the Merchant Center feed that contains the product. Use an ISO 639 code to specify a language. + #[serde(rename="productLanguage")] + pub product_language: Option, } impl Part for Conversion {} diff --git a/gen/drive2-cli/Cargo.toml b/gen/drive2-cli/Cargo.toml index 49c090e8e2..66a1be9600 100644 --- a/gen/drive2-cli/Cargo.toml +++ b/gen/drive2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-drive2-cli" -version = "0.3.0+20150326" +version = "0.3.0+20150305" authors = ["Sebastian Thiel "] description = "A complete library to interact with drive (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/drive2-cli" @@ -17,8 +17,8 @@ keywords = ["drive", "google", "cli"] name = "drive2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/drive2-cli/README.md b/gen/drive2-cli/README.md index bc93cb5df1..fbe8b6cab9 100644 --- a/gen/drive2-cli/README.md +++ b/gen/drive2-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *drive* API at revision *20150326*. The CLI is at version *0.3.0*. +This documentation was generated from the *drive* API at revision *20150305*. The CLI is at version *0.3.0*. ```bash drive2 [options] diff --git a/gen/drive2-cli/mkdocs.yml b/gen/drive2-cli/mkdocs.yml index d337724259..f2bb1a5c21 100644 --- a/gen/drive2-cli/mkdocs.yml +++ b/gen/drive2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: drive v0.3.0+20150326 +site_name: drive v0.3.0+20150305 site_url: http://byron.github.io/google-apis-rs/google-drive2-cli site_description: Write integrating applications with bcore diff --git a/gen/drive2-cli/src/main.rs b/gen/drive2-cli/src/main.rs index 9b09dac7cf..c1eb07620d 100644 --- a/gen/drive2-cli/src/main.rs +++ b/gen/drive2-cli/src/main.rs @@ -99,6 +99,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -150,6 +151,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -211,6 +213,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -262,6 +265,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -277,6 +281,9 @@ impl<'n, 'a> Engine<'n, 'a> { "start-change-id" => { call = call.start_change_id(value.unwrap_or("")); }, + "spaces" => { + call = call.spaces(value.unwrap_or("")); + }, "page-token" => { call = call.page_token(value.unwrap_or("")); }, @@ -302,7 +309,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["page-token", "include-deleted", "max-results", "start-change-id", "include-subscribed"].iter().map(|v|*v)); + v.extend(["include-subscribed", "include-deleted", "max-results", "page-token", "spaces", "start-change-id"].iter().map(|v|*v)); v } )); } } @@ -329,6 +336,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -386,6 +394,9 @@ impl<'n, 'a> Engine<'n, 'a> { "start-change-id" => { call = call.start_change_id(value.unwrap_or("")); }, + "spaces" => { + call = call.spaces(value.unwrap_or("")); + }, "page-token" => { call = call.page_token(value.unwrap_or("")); }, @@ -411,7 +422,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["page-token", "include-deleted", "max-results", "start-change-id", "include-subscribed"].iter().map(|v|*v)); + v.extend(["include-subscribed", "include-deleted", "max-results", "page-token", "spaces", "start-change-id"].iter().map(|v|*v)); v } )); } } @@ -438,6 +449,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -619,6 +631,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -706,6 +719,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -767,6 +781,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -866,6 +881,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -969,6 +985,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1033,6 +1050,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1136,6 +1154,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1239,6 +1258,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1362,13 +1382,14 @@ impl<'n, 'a> Engine<'n, 'a> { "user-permission.type" => Some(("userPermission.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.additional-roles" => Some(("userPermission.additionalRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-permission.self-link" => Some(("userPermission.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shared", "shared-with-me-date", "sharing-user", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1443,6 +1464,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1600,8 +1622,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -1726,13 +1750,14 @@ impl<'n, 'a> Engine<'n, 'a> { "user-permission.type" => Some(("userPermission.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.additional-roles" => Some(("userPermission.additionalRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-permission.self-link" => Some(("userPermission.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shared", "shared-with-me-date", "sharing-user", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1814,6 +1839,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1826,6 +1852,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "spaces" => { + call = call.spaces(value.unwrap_or("")); + }, "q" => { call = call.q(value.unwrap_or("")); }, @@ -1854,7 +1883,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["q", "page-token", "corpus", "projection", "max-results"].iter().map(|v|*v)); + v.extend(["projection", "max-results", "q", "page-token", "spaces", "corpus"].iter().map(|v|*v)); v } )); } } @@ -1881,6 +1910,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2004,13 +2034,14 @@ impl<'n, 'a> Engine<'n, 'a> { "user-permission.type" => Some(("userPermission.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.additional-roles" => Some(("userPermission.additionalRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-permission.self-link" => Some(("userPermission.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shared", "shared-with-me-date", "sharing-user", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2100,6 +2131,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2151,6 +2183,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2202,6 +2235,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2253,6 +2287,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2376,13 +2411,14 @@ impl<'n, 'a> Engine<'n, 'a> { "user-permission.type" => Some(("userPermission.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.additional-roles" => Some(("userPermission.additionalRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-permission.self-link" => Some(("userPermission.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shared", "shared-with-me-date", "sharing-user", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2476,6 +2512,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2587,8 +2624,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -2685,6 +2724,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2773,6 +2813,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2824,6 +2865,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2919,6 +2961,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2970,6 +3013,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3074,6 +3118,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3125,6 +3170,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3226,6 +3272,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3327,6 +3374,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3430,6 +3478,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3519,6 +3568,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3570,6 +3620,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3663,6 +3714,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3756,6 +3808,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3815,6 +3868,7 @@ impl<'n, 'a> Engine<'n, 'a> { if !download_mode { } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -3967,6 +4021,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4064,6 +4119,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4125,6 +4181,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4222,6 +4279,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4319,6 +4377,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4414,6 +4473,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4465,6 +4525,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4571,6 +4632,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4677,6 +4739,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5003,7 +5066,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() @@ -5016,7 +5079,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() @@ -6615,7 +6678,7 @@ fn main() { let mut app = App::new("drive2") .author("Sebastian Thiel ") - .version("0.3.0+20150326") + .version("0.3.0+20150305") .about("The API to interact with Drive.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_drive2_cli") .arg(Arg::with_name("url") diff --git a/gen/drive2/Cargo.toml b/gen/drive2/Cargo.toml index f4b9d0b0fa..9819a55131 100644 --- a/gen/drive2/Cargo.toml +++ b/gen/drive2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-drive2" -version = "0.1.8+20150326" +version = "0.1.8+20150305" authors = ["Sebastian Thiel "] description = "A complete library to interact with drive (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/drive2" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/drive2/README.md b/gen/drive2/README.md index bed8f698f1..85f45fed42 100644 --- a/gen/drive2/README.md +++ b/gen/drive2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-drive2` library allows access to all features of the *Google drive* service. -This documentation was generated from *drive* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *drive* crate version *0.1.8+20150305*, where *20150305* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *drive* *v2* API can be found at the [official documentation site](https://developers.google.com/drive/). diff --git a/gen/drive2/src/cmn.rs b/gen/drive2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/drive2/src/cmn.rs +++ b/gen/drive2/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/drive2/src/lib.rs b/gen/drive2/src/lib.rs index 6778e789ed..d69609f9bd 100644 --- a/gen/drive2/src/lib.rs +++ b/gen/drive2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *drive* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *drive* crate version *0.1.8+20150305*, where *20150305* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *drive* *v2* API can be found at the //! [official documentation site](https://developers.google.com/drive/). @@ -155,18 +155,18 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.files().patch(req, "fileId") -//! .use_content_as_indexable_text(true) +//! .use_content_as_indexable_text(false) //! .update_viewed_date(false) -//! .timed_text_track_name("sea") -//! .timed_text_language("consetetur") -//! .set_modified_date(false) -//! .remove_parents("accusam") +//! .timed_text_track_name("accusam") +//! .timed_text_language("dolores") +//! .set_modified_date(true) +//! .remove_parents("dolor") //! .pinned(false) -//! .ocr_language("consetetur") -//! .ocr(false) -//! .new_revision(false) +//! .ocr_language("elitr") +//! .ocr(true) +//! .new_revision(true) //! .convert(false) -//! .add_parents("ea") +//! .add_parents("sed") //! .doit(); //! //! match result { diff --git a/gen/drive2/src/lib.rs.in b/gen/drive2/src/lib.rs.in index e0e14b0f58..fa0f43e1b3 100644 --- a/gen/drive2/src/lib.rs.in +++ b/gen/drive2/src/lib.rs.in @@ -46,7 +46,7 @@ pub enum Scope { /// View metadata for files in your Google Drive MetadataReadonly, - /// View and manage Google Drive files that you have opened or created with this app + /// View and manage Google Drive files and folders that you have opened or created with this app File, /// Modify your Google Apps Script scripts' behavior @@ -394,7 +394,11 @@ pub struct About { /// The allowable export formats. #[serde(rename="exportFormats")] pub export_formats: Option>, - /// The domain sharing policy for the current user. + /// The domain sharing policy for the current user. Possible values are: + /// - ALLOWED + /// - ALLOWED_WITH_WARNING + /// - INCOMING_ONLY + /// - DISALLOWED #[serde(rename="domainSharingPolicy")] pub domain_sharing_policy: Option, /// A link back to this item. @@ -571,6 +575,8 @@ pub struct File { /// The permissions for the authenticated user on this file. #[serde(rename="userPermission")] pub user_permission: Option, + /// The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'. + pub spaces: Option>, /// 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. #[serde(rename="originalFilename")] pub original_filename: Option, @@ -1815,6 +1821,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { pub fn list(&self) -> FileListCall<'a, C, A> { FileListCall { hub: self.hub, + _spaces: Default::default(), _q: Default::default(), _projection: Default::default(), _page_token: Default::default(), @@ -3006,6 +3013,7 @@ impl<'a, C, A> ChangeMethods<'a, C, A> { hub: self.hub, _request: request, _start_change_id: Default::default(), + _spaces: Default::default(), _page_token: Default::default(), _max_results: Default::default(), _include_subscribed: Default::default(), @@ -3023,6 +3031,7 @@ impl<'a, C, A> ChangeMethods<'a, C, A> { ChangeListCall { hub: self.hub, _start_change_id: Default::default(), + _spaces: Default::default(), _page_token: Default::default(), _max_results: Default::default(), _include_subscribed: Default::default(), @@ -4068,7 +4077,7 @@ impl<'a, C, A> FileInsertCall<'a, C, A> where C: BorrowMut, A: oa self._pinned = Some(new_value); self } - /// If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes. + /// If ocr is true, hints at the language to use. Valid values are BCP 47 codes. /// /// Sets the *ocr language* query property to the given value. pub fn ocr_language(mut self, new_value: &str) -> FileInsertCall<'a, C, A> { @@ -4655,7 +4664,7 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut self._pinned = Some(new_value); self } - /// If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes. + /// If ocr is true, hints at the language to use. Valid values are BCP 47 codes. /// /// Sets the *ocr language* query property to the given value. pub fn ocr_language(mut self, new_value: &str) -> FileCopyCall<'a, C, A> { @@ -5183,11 +5192,12 @@ impl<'a, C, A> FileEmptyTrashCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().list() -/// .q("et") -/// .projection("duo") -/// .page_token("et") -/// .max_results(-40) -/// .corpus("sanctus") +/// .spaces("et") +/// .q("duo") +/// .projection("et") +/// .page_token("eirmod") +/// .max_results(-58) +/// .corpus("et") /// .doit(); /// # } /// ``` @@ -5195,6 +5205,7 @@ pub struct FileListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Drive, + _spaces: Option, _q: Option, _projection: Option, _page_token: Option, @@ -5221,7 +5232,10 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut }; dlg.begin(MethodInfo { id: "drive.files.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + if let Some(value) = self._spaces { + params.push(("spaces", value.to_string())); + } if let Some(value) = self._q { params.push(("q", value.to_string())); } @@ -5237,7 +5251,7 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut if let Some(value) = self._corpus { params.push(("corpus", value.to_string())); } - for &field in ["alt", "q", "projection", "pageToken", "maxResults", "corpus"].iter() { + for &field in ["alt", "spaces", "q", "projection", "pageToken", "maxResults", "corpus"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5332,6 +5346,13 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut } + /// A comma-separated list of spaces to query. Supported values are 'drive' and 'appDataFolder'. + /// + /// Sets the *spaces* query property to the given value. + pub fn spaces(mut self, new_value: &str) -> FileListCall<'a, C, A> { + self._spaces = Some(new_value.to_string()); + self + } /// Query string for searching files. /// /// Sets the *q* query property to the given value. @@ -5691,16 +5712,16 @@ impl<'a, C, A> FileTouchCall<'a, C, A> where C: BorrowMut, A: oau /// let result = hub.files().update(req, "fileId") /// .use_content_as_indexable_text(true) /// .update_viewed_date(true) -/// .timed_text_track_name("ut") -/// .timed_text_language("ea") -/// .set_modified_date(false) +/// .timed_text_track_name("ea") +/// .timed_text_language("sed") +/// .set_modified_date(true) /// .remove_parents("dolor") /// .pinned(true) -/// .ocr_language("dolor") -/// .ocr(true) +/// .ocr_language("et") +/// .ocr(false) /// .new_revision(false) -/// .convert(false) -/// .add_parents("voluptua.") +/// .convert(true) +/// .add_parents("Lorem") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -6096,7 +6117,7 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa self._pinned = Some(new_value); self } - /// If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes. + /// If ocr is true, hints at the language to use. Valid values are BCP 47 codes. /// /// Sets the *ocr language* query property to the given value. pub fn ocr_language(mut self, new_value: &str) -> FileUpdateCall<'a, C, A> { @@ -6110,7 +6131,7 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa self._ocr = Some(new_value); self } - /// 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 revisions are preserved (causing increased use of the user's data storage quota). + /// 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. /// /// Sets the *new revision* query property to the given value. pub fn new_revision(mut self, new_value: bool) -> FileUpdateCall<'a, C, A> { @@ -6441,18 +6462,18 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().patch(req, "fileId") -/// .use_content_as_indexable_text(true) -/// .update_viewed_date(false) -/// .timed_text_track_name("vero") -/// .timed_text_language("diam") -/// .set_modified_date(false) -/// .remove_parents("consetetur") -/// .pinned(true) -/// .ocr_language("vero") +/// .use_content_as_indexable_text(false) +/// .update_viewed_date(true) +/// .timed_text_track_name("diam") +/// .timed_text_language("rebum.") +/// .set_modified_date(true) +/// .remove_parents("sadipscing") +/// .pinned(false) +/// .ocr_language("sadipscing") /// .ocr(false) /// .new_revision(false) /// .convert(false) -/// .add_parents("dolore") +/// .add_parents("duo") /// .doit(); /// # } /// ``` @@ -6732,7 +6753,7 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau self._pinned = Some(new_value); self } - /// If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes. + /// If ocr is true, hints at the language to use. Valid values are BCP 47 codes. /// /// Sets the *ocr language* query property to the given value. pub fn ocr_language(mut self, new_value: &str) -> FilePatchCall<'a, C, A> { @@ -6746,7 +6767,7 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau self._ocr = Some(new_value); self } - /// 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 revisions are preserved (causing increased use of the user's data storage quota). + /// 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. /// /// Sets the *new revision* query property to the given value. pub fn new_revision(mut self, new_value: bool) -> FilePatchCall<'a, C, A> { @@ -6851,9 +6872,9 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().get("fileId") -/// .update_viewed_date(false) -/// .revision_id("Lorem") -/// .projection("et") +/// .update_viewed_date(true) +/// .revision_id("et") +/// .projection("clita") /// .acknowledge_abuse(true) /// .doit(); /// # } @@ -7151,8 +7172,8 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.about().get() -/// .start_change_id("consetetur") -/// .max_change_id_count(-58) +/// .start_change_id("takimata") +/// .max_change_id_count(-40) /// .include_subscribed(true) /// .doit(); /// # } @@ -7391,7 +7412,7 @@ impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.realtime().update("fileId") -/// .base_revision("sanctus") +/// .base_revision("takimata") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -7742,7 +7763,7 @@ impl<'a, C, A> RealtimeUpdateCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.realtime().get("fileId") -/// .revision(-27) +/// .revision(-86) /// .doit(); /// # } /// ``` @@ -8215,9 +8236,9 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.apps().list() -/// .language_code("invidunt") -/// .app_filter_mime_types("ea") -/// .app_filter_extensions("sadipscing") +/// .language_code("ea") +/// .app_filter_mime_types("sadipscing") +/// .app_filter_extensions("rebum.") /// .doit(); /// # } /// ``` @@ -9776,10 +9797,10 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().list("fileId") -/// .updated_min("gubergren") -/// .page_token("aliquyam") -/// .max_results(-24) -/// .include_deleted(true) +/// .updated_min("aliquyam") +/// .page_token("eos") +/// .max_results(-38) +/// .include_deleted(false) /// .doit(); /// # } /// ``` @@ -10060,9 +10081,9 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.children().list("folderId") -/// .q("labore") -/// .page_token("ipsum") -/// .max_results(-31) +/// .q("ipsum") +/// .page_token("aliquyam") +/// .max_results(-69) /// .doit(); /// # } /// ``` @@ -12586,9 +12607,9 @@ impl<'a, C, A> ReplyPatchCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.replies().list("fileId", "commentId") -/// .page_token("eos") -/// .max_results(-78) -/// .include_deleted(true) +/// .page_token("voluptua.") +/// .max_results(-19) +/// .include_deleted(false) /// .doit(); /// # } /// ``` @@ -12870,7 +12891,7 @@ impl<'a, C, A> ReplyListCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.replies().get("fileId", "commentId", "replyId") -/// .include_deleted(true) +/// .include_deleted(false) /// .doit(); /// # } /// ``` @@ -14204,8 +14225,8 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().insert(req, "fileId") -/// .send_notification_emails(false) -/// .email_message("et") +/// .send_notification_emails(true) +/// .email_message("sed") /// .doit(); /// # } /// ``` @@ -15797,10 +15818,11 @@ impl<'a, C, A> PermissionGetIdForEmailCall<'a, C, A> where C: BorrowMut hub: &'a Drive, _request: Channel, _start_change_id: Option, + _spaces: Option, _page_token: Option, _max_results: Option, _include_subscribed: Option, @@ -15836,10 +15859,13 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o }; dlg.begin(MethodInfo { id: "drive.changes.watch", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); if let Some(value) = self._start_change_id { params.push(("startChangeId", value.to_string())); } + if let Some(value) = self._spaces { + params.push(("spaces", value.to_string())); + } if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } @@ -15852,7 +15878,7 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o if let Some(value) = self._include_deleted { params.push(("includeDeleted", value.to_string())); } - for &field in ["alt", "startChangeId", "pageToken", "maxResults", "includeSubscribed", "includeDeleted"].iter() { + for &field in ["alt", "startChangeId", "spaces", "pageToken", "maxResults", "includeSubscribed", "includeDeleted"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15978,6 +16004,13 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o self._start_change_id = Some(new_value.to_string()); self } + /// A comma-separated list of spaces to query. Supported values are 'drive' and 'appDataFolder'. + /// + /// Sets the *spaces* query property to the given value. + pub fn spaces(mut self, new_value: &str) -> ChangeWatchCall<'a, C, A> { + self._spaces = Some(new_value.to_string()); + self + } /// Page token for changes. /// /// Sets the *page token* query property to the given value. @@ -16085,11 +16118,12 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.changes().list() -/// .start_change_id("sea") -/// .page_token("ut") -/// .max_results(-39) +/// .start_change_id("eirmod") +/// .spaces("sanctus") +/// .page_token("voluptua.") +/// .max_results(-99) /// .include_subscribed(true) -/// .include_deleted(true) +/// .include_deleted(false) /// .doit(); /// # } /// ``` @@ -16098,6 +16132,7 @@ pub struct ChangeListCall<'a, C, A> hub: &'a Drive, _start_change_id: Option, + _spaces: Option, _page_token: Option, _max_results: Option, _include_subscribed: Option, @@ -16123,10 +16158,13 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "drive.changes.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); if let Some(value) = self._start_change_id { params.push(("startChangeId", value.to_string())); } + if let Some(value) = self._spaces { + params.push(("spaces", value.to_string())); + } if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } @@ -16139,7 +16177,7 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._include_deleted { params.push(("includeDeleted", value.to_string())); } - for &field in ["alt", "startChangeId", "pageToken", "maxResults", "includeSubscribed", "includeDeleted"].iter() { + for &field in ["alt", "startChangeId", "spaces", "pageToken", "maxResults", "includeSubscribed", "includeDeleted"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -16241,6 +16279,13 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa self._start_change_id = Some(new_value.to_string()); self } + /// A comma-separated list of spaces to query. Supported values are 'drive' and 'appDataFolder'. + /// + /// Sets the *spaces* query property to the given value. + pub fn spaces(mut self, new_value: &str) -> ChangeListCall<'a, C, A> { + self._spaces = Some(new_value.to_string()); + self + } /// Page token for changes. /// /// Sets the *page token* query property to the given value. @@ -16590,7 +16635,7 @@ impl<'a, C, A> ChangeGetCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().patch(req, "fileId", "propertyKey") -/// .visibility("vero") +/// .visibility("et") /// .doit(); /// # } /// ``` @@ -16875,7 +16920,7 @@ impl<'a, C, A> PropertyPatchCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().delete("fileId", "propertyKey") -/// .visibility("et") +/// .visibility("dolore") /// .doit(); /// # } /// ``` @@ -17633,7 +17678,7 @@ impl<'a, C, A> PropertyListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().update(req, "fileId", "propertyKey") -/// .visibility("dolor") +/// .visibility("nonumy") /// .doit(); /// # } /// ``` @@ -17918,7 +17963,7 @@ impl<'a, C, A> PropertyUpdateCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().get("fileId", "propertyKey") -/// .visibility("nonumy") +/// .visibility("no") /// .doit(); /// # } /// ``` diff --git a/gen/fitness1-cli/Cargo.toml b/gen/fitness1-cli/Cargo.toml index 6f34a9e14f..1028a51117 100644 --- a/gen/fitness1-cli/Cargo.toml +++ b/gen/fitness1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-fitness1-cli" -version = "0.3.0+20150326" +version = "0.3.0+20150527" authors = ["Sebastian Thiel "] description = "A complete library to interact with fitness (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fitness1-cli" @@ -17,8 +17,8 @@ keywords = ["fitness", "google", "cli"] name = "fitness1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/fitness1-cli/README.md b/gen/fitness1-cli/README.md index f4e9f068dc..4e09da43e3 100644 --- a/gen/fitness1-cli/README.md +++ b/gen/fitness1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *fitness* API at revision *20150326*. The CLI is at version *0.3.0*. +This documentation was generated from the *fitness* API at revision *20150527*. The CLI is at version *0.3.0*. ```bash fitness1 [options] @@ -38,6 +38,7 @@ fitness1 [options] data-sources-list [-p ]... [-o ] data-sources-patch (-r )... [-p ]... [-o ] data-sources-update (-r )... [-p ]... [-o ] + dataset-aggregate (-r )... [-p ]... [-o ] sessions-delete [-p ]... sessions-list [-p ]... [-o ] sessions-update (-r )... [-p ]... [-o ] diff --git a/gen/fitness1-cli/mkdocs.yml b/gen/fitness1-cli/mkdocs.yml index faf0a6e8d5..2773193b92 100644 --- a/gen/fitness1-cli/mkdocs.yml +++ b/gen/fitness1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: fitness v0.3.0+20150326 +site_name: fitness v0.3.0+20150527 site_url: http://byron.github.io/google-apis-rs/google-fitness1-cli site_description: Write integrating applications with bcore @@ -18,6 +18,7 @@ pages: - ['users_data-sources-list.md', 'Users', 'Data Sources List'] - ['users_data-sources-patch.md', 'Users', 'Data Sources Patch'] - ['users_data-sources-update.md', 'Users', 'Data Sources Update'] +- ['users_dataset-aggregate.md', 'Users', 'Dataset Aggregate'] - ['users_sessions-delete.md', 'Users', 'Sessions Delete'] - ['users_sessions-list.md', 'Users', 'Sessions List'] - ['users_sessions-update.md', 'Users', 'Sessions Update'] diff --git a/gen/fitness1-cli/src/main.rs b/gen/fitness1-cli/src/main.rs index ba30623188..9e57d6bb54 100644 --- a/gen/fitness1-cli/src/main.rs +++ b/gen/fitness1-cli/src/main.rs @@ -135,6 +135,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -244,6 +245,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -335,6 +337,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -386,6 +389,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -437,6 +441,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -492,6 +497,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -589,6 +595,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -686,6 +693,96 @@ impl<'n, 'a> Engine<'n, 'a> { 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 _users_dataset_aggregate(&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()[..] { + "bucket-by-activity-segment.activity-data-source-id" => Some(("bucketByActivitySegment.activityDataSourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bucket-by-activity-segment.min-duration-millis" => Some(("bucketByActivitySegment.minDurationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time-millis" => Some(("endTimeMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bucket-by-session.min-duration-millis" => Some(("bucketBySession.minDurationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bucket-by-activity-type.activity-data-source-id" => Some(("bucketByActivityType.activityDataSourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bucket-by-activity-type.min-duration-millis" => Some(("bucketByActivityType.minDurationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-time-millis" => Some(("startTimeMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bucket-by-time.duration-millis" => Some(("bucketByTime.durationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["activity-data-source-id", "bucket-by-activity-segment", "bucket-by-activity-type", "bucket-by-session", "bucket-by-time", "duration-millis", "end-time-millis", "min-duration-millis", "start-time-millis"]); + 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::AggregateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.users().dataset_aggregate(request, opt.value_of("user-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); + 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(()) } } @@ -798,6 +895,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -897,6 +995,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -937,6 +1036,9 @@ impl<'n, 'a> Engine<'n, 'a> { ("data-sources-update", Some(opt)) => { call_result = self._users_data_sources_update(opt, dry_run, &mut err); }, + ("dataset-aggregate", Some(opt)) => { + call_result = self._users_dataset_aggregate(opt, dry_run, &mut err); + }, ("sessions-delete", Some(opt)) => { call_result = self._users_sessions_delete(opt, dry_run, &mut err); }, @@ -986,7 +1088,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() @@ -999,7 +1101,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() @@ -1034,7 +1136,7 @@ impl<'n, 'a> Engine<'n, 'a> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("users", "methods: 'data-sources-create', 'data-sources-datasets-delete', 'data-sources-datasets-get', 'data-sources-datasets-patch', 'data-sources-delete', 'data-sources-get', 'data-sources-list', 'data-sources-patch', 'data-sources-update', 'sessions-delete', 'sessions-list' and 'sessions-update'", vec![ + ("users", "methods: 'data-sources-create', 'data-sources-datasets-delete', 'data-sources-datasets-get', 'data-sources-datasets-patch', 'data-sources-delete', 'data-sources-get', 'data-sources-list', 'data-sources-patch', 'data-sources-update', 'dataset-aggregate', 'sessions-delete', 'sessions-list' and 'sessions-update'", vec![ ("data-sources-create", Some(r##"Creates a new data source that is unique across all data sources belonging to this user. The data stream ID field can be omitted and will be generated by the server with the correct format. The data stream ID is an ordered combination of some fields from the data source. In addition to the data source fields reflected into the data source ID, the developer project number that is authenticated when creating the data source is included. This developer project number is obfuscated when read by any other developer reading public data types."##), "Details at http://byron.github.io/google-apis-rs/google_fitness1_cli/users_data-sources-create", @@ -1309,6 +1411,34 @@ fn main() { 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)), + ]), + ("dataset-aggregate", + None, + "Details at http://byron.github.io/google-apis-rs/google_fitness1_cli/users_dataset-aggregate", + vec![ + (Some(r##"user-id"##), + None, + None, + 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"##), @@ -1399,7 +1529,7 @@ fn main() { let mut app = App::new("fitness1") .author("Sebastian Thiel ") - .version("0.3.0+20150326") + .version("0.3.0+20150527") .about("Google Fit API") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_fitness1_cli") .arg(Arg::with_name("url") diff --git a/gen/fitness1/Cargo.toml b/gen/fitness1/Cargo.toml index 4439faff78..f27c61da32 100644 --- a/gen/fitness1/Cargo.toml +++ b/gen/fitness1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-fitness1" -version = "0.1.8+20150326" +version = "0.1.8+20150527" authors = ["Sebastian Thiel "] description = "A complete library to interact with fitness (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fitness1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/fitness1/README.md b/gen/fitness1/README.md index f9613c72a6..2555ab9fae 100644 --- a/gen/fitness1/README.md +++ b/gen/fitness1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-fitness1` library allows access to all features of the *Google fitness* service. -This documentation was generated from *fitness* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *fitness* crate version *0.1.8+20150527*, where *20150527* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *fitness* *v1* API can be found at the [official documentation site](https://developers.google.com/fit/rest/). @@ -14,7 +14,7 @@ Everything else about the *fitness* *v1* API can be found at the Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_fitness1/struct.Fitness.html) ... * users - * [*data sources create*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceCreateCall.html), [*data sources datasets delete*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceDatasetDeleteCall.html), [*data sources datasets get*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceDatasetGetCall.html), [*data sources datasets patch*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceDatasetPatchCall.html), [*data sources delete*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceDeleteCall.html), [*data sources get*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceGetCall.html), [*data sources list*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceListCall.html), [*data sources patch*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourcePatchCall.html), [*data sources update*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceUpdateCall.html), [*sessions delete*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserSessionDeleteCall.html), [*sessions list*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserSessionListCall.html) and [*sessions update*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserSessionUpdateCall.html) + * [*data sources create*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceCreateCall.html), [*data sources datasets delete*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceDatasetDeleteCall.html), [*data sources datasets get*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceDatasetGetCall.html), [*data sources datasets patch*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceDatasetPatchCall.html), [*data sources delete*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceDeleteCall.html), [*data sources get*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceGetCall.html), [*data sources list*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceListCall.html), [*data sources patch*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourcePatchCall.html), [*data sources update*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDataSourceUpdateCall.html), [*dataset aggregate*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserDatasetAggregateCall.html), [*sessions delete*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserSessionDeleteCall.html), [*sessions list*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserSessionListCall.html) and [*sessions update*](http://byron.github.io/google-apis-rs/google_fitness1/struct.UserSessionUpdateCall.html) diff --git a/gen/fitness1/src/cmn.rs b/gen/fitness1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/fitness1/src/cmn.rs +++ b/gen/fitness1/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/fitness1/src/lib.rs b/gen/fitness1/src/lib.rs index 1f3bb355bc..a3864a1abf 100644 --- a/gen/fitness1/src/lib.rs +++ b/gen/fitness1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *fitness* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *fitness* crate version *0.1.8+20150527*, where *20150527* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *fitness* *v1* API can be found at the //! [official documentation site](https://developers.google.com/fit/rest/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Fitness.html) ... //! //! * users -//! * [*data sources create*](struct.UserDataSourceCreateCall.html), [*data sources datasets delete*](struct.UserDataSourceDatasetDeleteCall.html), [*data sources datasets get*](struct.UserDataSourceDatasetGetCall.html), [*data sources datasets patch*](struct.UserDataSourceDatasetPatchCall.html), [*data sources delete*](struct.UserDataSourceDeleteCall.html), [*data sources get*](struct.UserDataSourceGetCall.html), [*data sources list*](struct.UserDataSourceListCall.html), [*data sources patch*](struct.UserDataSourcePatchCall.html), [*data sources update*](struct.UserDataSourceUpdateCall.html), [*sessions delete*](struct.UserSessionDeleteCall.html), [*sessions list*](struct.UserSessionListCall.html) and [*sessions update*](struct.UserSessionUpdateCall.html) +//! * [*data sources create*](struct.UserDataSourceCreateCall.html), [*data sources datasets delete*](struct.UserDataSourceDatasetDeleteCall.html), [*data sources datasets get*](struct.UserDataSourceDatasetGetCall.html), [*data sources datasets patch*](struct.UserDataSourceDatasetPatchCall.html), [*data sources delete*](struct.UserDataSourceDeleteCall.html), [*data sources get*](struct.UserDataSourceGetCall.html), [*data sources list*](struct.UserDataSourceListCall.html), [*data sources patch*](struct.UserDataSourcePatchCall.html), [*data sources update*](struct.UserDataSourceUpdateCall.html), [*dataset aggregate*](struct.UserDatasetAggregateCall.html), [*sessions delete*](struct.UserSessionDeleteCall.html), [*sessions list*](struct.UserSessionListCall.html) and [*sessions update*](struct.UserSessionUpdateCall.html) //! //! //! diff --git a/gen/fitness1/src/lib.rs.in b/gen/fitness1/src/lib.rs.in index d3d18c1796..acb709f89a 100644 --- a/gen/fitness1/src/lib.rs.in +++ b/gen/fitness1/src/lib.rs.in @@ -174,19 +174,131 @@ impl<'a, C, A> Fitness // ############ // SCHEMAS ### // ########## -/// See: google3/java/com/google/android/apps/heart/platform/api/DataType.java +/// 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 DataType { - /// A field represents one dimension of a data type. - pub field: Option>, - /// Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform. - pub name: Option, +pub struct AggregateBy { + /// no description provided + #[serde(rename="outputDataTypeName")] + pub output_data_type_name: Option, + /// no description provided + #[serde(rename="dataSourceId")] + pub data_source_id: Option, + /// by dataype or by datasource + #[serde(rename="dataTypeName")] + pub data_type_name: Option, + /// no description provided + #[serde(rename="outputDataSourceId")] + pub output_data_source_id: Option, } -impl Part for DataType {} +impl Part for AggregateBy {} + + +/// 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*). +/// +/// * [sessions list users](struct.UserSessionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListSessionsResponse { + /// 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. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// If includeDeleted is set to true in the request, this list will contain sessions deleted with original end times that are within the startTime and endTime frame. + #[serde(rename="deletedSession")] + pub deleted_session: Option>, + /// Sessions with an end time that is between startTime and endTime of the request. + pub session: Option>, +} + +impl ResponseResult for ListSessionsResponse {} + + +/// 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*). +/// +/// * [data sources list users](struct.UserDataSourceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDataSourcesResponse { + /// A previously created data source. + #[serde(rename="dataSource")] + pub data_source: Option>, +} + +impl ResponseResult for ListDataSourcesResponse {} + + +/// See: google3/java/com/google/android/apps/heart/platform/api/Application.java +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Application { + /// Package name for this application. This is used as a unique identifier when created by Android applications, but cannot be specified by REST clients. REST clients will have their developer project number reflected into the Data Source data stream IDs, instead of the packageName. + #[serde(rename="packageName")] + pub package_name: Option, + /// Version of the application. You should update this field whenever the application changes in a way that affects the computation of the data. + pub version: Option, + /// The name of this application. This is required for REST clients, but we do not enforce uniqueness of this name. It is provided as a matter of convenience for other developers who would like to identify which REST created an Application or Data Source. + pub name: Option, + /// An optional URI that can be used to link back to the application. + #[serde(rename="detailsUrl")] + pub details_url: Option, +} + +impl Part for Application {} + + +/// Represents a single data point, generated by a particular data source. A data point holds a value for each field, an end timestamp and an optional start time. The exact semantics of each of these attributes are specified in the documentation for the particular data type. +/// +/// A data point can represent an instantaneous measurement, reading or input observation, as well as averages or aggregates over a time interval. Check the data type documentation to determine which is the case for a particular data type. +/// +/// Data points always contain one value for each field of the data type. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DataPoint { + /// Used for version checking during transformation; that is, a datapoint can only replace another datapoint that has an older computation time stamp. + #[serde(rename="computationTimeMillis")] + pub computation_time_millis: Option, + /// Indicates the last time this data point was modified. Useful only in contexts where we are listing the data changes, rather than representing the current state of the data. + #[serde(rename="modifiedTimeMillis")] + pub modified_time_millis: Option, + /// The start time of the interval represented by this data point, in nanoseconds since epoch. + #[serde(rename="startTimeNanos")] + pub start_time_nanos: Option, + /// The data type defining the format of the values in this data point. + #[serde(rename="dataTypeName")] + pub data_type_name: Option, + /// Values of each data type field for the data point. It is expected that each value corresponding to a data type field will occur in the same order that the field is listed with in the data type specified in a data source. + /// + /// Only one of integer and floating point fields will be populated, depending on the format enum value within data source's type field. + pub value: Option>, + /// The end time of the interval represented by this data point, in nanoseconds since epoch. + #[serde(rename="endTimeNanos")] + pub end_time_nanos: Option, + /// If the data point is contained in a dataset for a derived data source, this field will be populated with the data source stream ID that created the data point originally. + #[serde(rename="originDataSourceId")] + pub origin_data_source_id: Option, + /// The raw timestamp from the original SensorEvent. + #[serde(rename="rawTimestampNanos")] + pub raw_timestamp_nanos: Option, +} + +impl Part for DataPoint {} /// Holder object for the value of a single field in a data point. @@ -208,6 +320,101 @@ pub struct Value { impl Part for Value {} +/// 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 AggregateBucket { + /// available for Bucket.Type.SESSION + pub session: Option, + /// no description provided + #[serde(rename="endTimeMillis")] + pub end_time_millis: Option, + /// available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT + pub activity: Option, + /// no description provided + #[serde(rename="startTimeMillis")] + pub start_time_millis: Option, + /// The type of a bucket signifies how the data aggregation is performed in the bucket. + #[serde(rename="type")] + pub type_: Option, + /// There will be one dataset per datatype/datasource + pub dataset: Option>, +} + +impl Part for AggregateBucket {} + + +/// 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 BucketByActivity { + /// default activity stream will be used if not specified + #[serde(rename="activityDataSourceId")] + pub activity_data_source_id: Option, + /// Only activity segments of duration longer than this is used + #[serde(rename="minDurationMillis")] + pub min_duration_millis: Option, +} + +impl Part for BucketByActivity {} + + +/// 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*). +/// +/// * [dataset aggregate users](struct.UserDatasetAggregateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AggregateRequest { + /// no description provided + #[serde(rename="aggregateBy")] + pub aggregate_by: Option>, + /// no description provided + #[serde(rename="bucketByActivitySegment")] + pub bucket_by_activity_segment: Option, + /// no description provided + #[serde(rename="endTimeMillis")] + pub end_time_millis: Option, + /// no description provided + #[serde(rename="bucketBySession")] + pub bucket_by_session: Option, + /// no description provided + #[serde(rename="bucketByActivityType")] + pub bucket_by_activity_type: Option, + /// required time range + #[serde(rename="startTimeMillis")] + pub start_time_millis: Option, + /// apparently oneof is not supported by reduced_nano_proto + #[serde(rename="bucketByTime")] + pub bucket_by_time: Option, +} + +impl RequestValue for AggregateRequest {} + + +/// See: google3/java/com/google/android/apps/heart/platform/api/DataType.java +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DataType { + /// A field represents one dimension of a data type. + pub field: Option>, + /// Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform. + pub name: Option, +} + +impl Part for DataType {} + + /// A dataset represents a projection container for data points. They do not carry any info of their own. Datasets represent a set of data points from a particular data source. A data point can be found in more than one dataset. /// /// # Activities @@ -247,37 +454,15 @@ impl ResponseResult for Dataset {} /// 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*). /// -/// * [data sources list users](struct.UserDataSourceListCall.html) (response) +/// * [dataset aggregate users](struct.UserDatasetAggregateCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListDataSourcesResponse { - /// A previously created data source. - #[serde(rename="dataSource")] - pub data_source: Option>, +pub struct AggregateResponse { + /// no description provided + pub bucket: Option>, } -impl ResponseResult for ListDataSourcesResponse {} - - -/// See: google3/java/com/google/android/apps/heart/platform/api/Application.java -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Application { - /// Package name for this application. This is used as a unique identifier when created by Android applications, but cannot be specified by REST clients. REST clients will have their developer project number reflected into the Data Source data stream IDs, instead of the packageName. - #[serde(rename="packageName")] - pub package_name: Option, - /// Version of the application. You should update this field whenever the application changes in a way that affects the computation of the data. - pub version: Option, - /// The name of this application. This is required for REST clients, but we do not enforce uniqueness of this name. It is provided as a matter of convenience for other developers who would like to identify which REST created an Application or Data Source. - pub name: Option, - /// An optional URI that can be used to link back to the application. - #[serde(rename="detailsUrl")] - pub details_url: Option, -} - -impl Part for Application {} +impl ResponseResult for AggregateResponse {} /// Sessions contain metadata, such as a user-friendly name and time interval information. @@ -322,113 +507,16 @@ impl ResponseResult for Session {} /// 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*). -/// -/// * [sessions list users](struct.UserSessionListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListSessionsResponse { - /// 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. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// If includeDeleted is set to true in the request, this list will contain sessions deleted with original end times that are within the startTime and endTime frame. - #[serde(rename="deletedSession")] - pub deleted_session: Option>, - /// Sessions with an end time that is between startTime and endTime of the request. - pub session: Option>, -} - -impl ResponseResult for ListSessionsResponse {} - - -/// Representation of an integrated device (such as a phone or a wearable) that can hold sensors. Each sensor is exposed as a data source. -/// -/// The main purpose of the device information contained in this class is to identify the hardware of a particular data source. This can be useful in different ways, including: -/// - Distinguishing two similar sensors on different devices (the step counter on two nexus 5 phones, for instance) -/// - Display the source of data to the user (by using the device make / model) -/// - Treat data differently depending on sensor type (accelerometers on a watch may give different patterns than those on a phone) -/// - Build different analysis models for each device/version. -/// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Device { - /// End-user visible model name for the device. - pub model: Option, - /// Version string for the device hardware/software. - pub version: Option, - /// A constant representing the type of the device. - #[serde(rename="type")] - pub type_: Option, - /// The serial number or other unique ID for the hardware. This field is obfuscated when read by any REST or Android client that did not create the data source. Only the data source creator will see the uid field in clear and normal form. - pub uid: Option, - /// Manufacturer of the product/hardware. - pub manufacturer: Option, +pub struct BucketBySession { + /// Only sessions of duration longer than this is used + #[serde(rename="minDurationMillis")] + pub min_duration_millis: Option, } -impl Part for Device {} - - -/// In case of multi-dimensional data (such as an accelerometer with x, y, and z axes) each field represents one dimension. Each data type field has a unique name which identifies it. The field also defines the format of the data (int, float, etc.). -/// -/// This message is only instantiated in code and not used for wire comms or stored in any way. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DataTypeField { - /// no description provided - pub optional: Option, - /// Defines the name and format of data. Unlike data type names, field names are not namespaced, and only need to be unique within the data type. - pub name: Option, - /// The different supported formats for each field in a data type. - pub format: Option, -} - -impl Part for DataTypeField {} - - -/// Represents a single data point, generated by a particular data source. A data point holds a value for each field, an end timestamp and an optional start time. The exact semantics of each of these attributes are specified in the documentation for the particular data type. -/// -/// A data point can represent an instantaneous measurement, reading or input observation, as well as averages or aggregates over a time interval. Check the data type documentation to determine which is the case for a particular data type. -/// -/// Data points always contain one value for each field of the data type. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DataPoint { - /// Used for version checking during transformation; that is, a datapoint can only replace another datapoint that has an older computation time stamp. - #[serde(rename="computationTimeMillis")] - pub computation_time_millis: Option, - /// Indicates the last time this data point was modified. Useful only in contexts where we are listing the data changes, rather than representing the current state of the data. - #[serde(rename="modifiedTimeMillis")] - pub modified_time_millis: Option, - /// The start time of the interval represented by this data point, in nanoseconds since epoch. - #[serde(rename="startTimeNanos")] - pub start_time_nanos: Option, - /// The data type defining the format of the values in this data point. - #[serde(rename="dataTypeName")] - pub data_type_name: Option, - /// Values of each data type field for the data point. It is expected that each value corresponding to a data type field will occur in the same order that the field is listed with in the data type specified in a data source. - /// - /// Only one of integer and floating point fields will be populated, depending on the format enum value within data source's type field. - pub value: Option>, - /// The end time of the interval represented by this data point, in nanoseconds since epoch. - #[serde(rename="endTimeNanos")] - pub end_time_nanos: Option, - /// If the data point is contained in a dataset for a derived data source, this field will be populated with the data source stream ID that created the data point originally. - #[serde(rename="originDataSourceId")] - pub origin_data_source_id: Option, - /// The raw timestamp from the original SensorEvent. - #[serde(rename="rawTimestampNanos")] - pub raw_timestamp_nanos: Option, -} - -impl Part for DataPoint {} +impl Part for BucketBySession {} /// Definition of a unique source of sensor data. Data sources can expose raw data coming from hardware sensors on local or companion devices. They can also expose derived data, created by transforming or merging other data sources. Multiple data sources can exist for the same data type. Every data point inserted into or read from this service has an associated data source. @@ -488,6 +576,67 @@ impl RequestValue for DataSource {} impl ResponseResult for DataSource {} +/// Representation of an integrated device (such as a phone or a wearable) that can hold sensors. Each sensor is exposed as a data source. +/// +/// The main purpose of the device information contained in this class is to identify the hardware of a particular data source. This can be useful in different ways, including: +/// - Distinguishing two similar sensors on different devices (the step counter on two nexus 5 phones, for instance) +/// - Display the source of data to the user (by using the device make / model) +/// - Treat data differently depending on sensor type (accelerometers on a watch may give different patterns than those on a phone) +/// - Build different analysis models for each device/version. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Device { + /// End-user visible model name for the device. + pub model: Option, + /// Version string for the device hardware/software. + pub version: Option, + /// A constant representing the type of the device. + #[serde(rename="type")] + pub type_: Option, + /// The serial number or other unique ID for the hardware. This field is obfuscated when read by any REST or Android client that did not create the data source. Only the data source creator will see the uid field in clear and normal form. + pub uid: Option, + /// Manufacturer of the product/hardware. + pub manufacturer: Option, +} + +impl Part for Device {} + + +/// In case of multi-dimensional data (such as an accelerometer with x, y, and z axes) each field represents one dimension. Each data type field has a unique name which identifies it. The field also defines the format of the data (int, float, etc.). +/// +/// This message is only instantiated in code and not used for wire comms or stored in any way. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DataTypeField { + /// no description provided + pub optional: Option, + /// Defines the name and format of data. Unlike data type names, field names are not namespaced, and only need to be unique within the data type. + pub name: Option, + /// The different supported formats for each field in a data type. + pub format: Option, +} + +impl Part for DataTypeField {} + + +/// 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 BucketByTime { + /// no description provided + #[serde(rename="durationMillis")] + pub duration_millis: Option, +} + +impl Part for BucketByTime {} + + // ################### // MethodBuilders ### @@ -516,7 +665,7 @@ impl ResponseResult for DataSource {} /// ::default(), None); /// let mut hub = Fitness::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `data_sources_create(...)`, `data_sources_datasets_delete(...)`, `data_sources_datasets_get(...)`, `data_sources_datasets_patch(...)`, `data_sources_delete(...)`, `data_sources_get(...)`, `data_sources_list(...)`, `data_sources_patch(...)`, `data_sources_update(...)`, `sessions_delete(...)`, `sessions_list(...)` and `sessions_update(...)` +/// // like `data_sources_create(...)`, `data_sources_datasets_delete(...)`, `data_sources_datasets_get(...)`, `data_sources_datasets_patch(...)`, `data_sources_delete(...)`, `data_sources_get(...)`, `data_sources_list(...)`, `data_sources_patch(...)`, `data_sources_update(...)`, `dataset_aggregate(...)`, `sessions_delete(...)`, `sessions_list(...)` and `sessions_update(...)` /// // to build up your call. /// let rb = hub.users(); /// # } @@ -531,6 +680,21 @@ impl<'a, C, A> MethodsBuilder for UserMethods<'a, C, A> {} impl<'a, C, A> UserMethods<'a, C, A> { + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `userId` - No description provided. + pub fn dataset_aggregate(&self, request: AggregateRequest, user_id: &str) -> UserDatasetAggregateCall<'a, C, A> { + UserDatasetAggregateCall { + hub: self.hub, + _request: request, + _user_id: user_id.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Delete the data source if there are no datapoints associated with it @@ -794,6 +958,247 @@ impl<'a, C, A> UserMethods<'a, C, A> { // CallBuilders ### // ################# +/// A builder for the *dataset.aggregate* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_fitness1 as fitness1; +/// use fitness1::AggregateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use fitness1::Fitness; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Fitness::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 = AggregateRequest::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.users().dataset_aggregate(req, "userId") +/// .doit(); +/// # } +/// ``` +pub struct UserDatasetAggregateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Fitness, + _request: AggregateRequest, + _user_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for UserDatasetAggregateCall<'a, C, A> {} + +impl<'a, C, A> UserDatasetAggregateCall<'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, AggregateResponse)> { + 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: "fitness.users.dataset.aggregate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "userId"].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://www.googleapis.com/fitness/v1/users/{userId}/dataset:aggregate".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + for &(find_this, param_name) in [("{userId}", "userId")].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 ["userId"].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 { + 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(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: AggregateRequest) -> UserDatasetAggregateCall<'a, C, A> { + self._request = new_value; + self + } + /// + /// Sets the *user 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 user_id(mut self, new_value: &str) -> UserDatasetAggregateCall<'a, C, A> { + self._user_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) -> UserDatasetAggregateCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserDatasetAggregateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + /// Delete the data source if there are no datapoints associated with it /// /// A builder for the *dataSources.delete* method supported by a *user* resource. @@ -1069,8 +1474,8 @@ impl<'a, C, A> UserDataSourceDeleteCall<'a, C, A> where C: BorrowMut UserDataSourceCreateCall<'a, C, A> where C: BorrowMut UserDataSourceDatasetDeleteCall<'a, C, A> where C: BorrowMut UserDataSourceUpdateCall<'a, C, A> where C: BorrowMut UserSessionListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().sessions_update(req, "userId", "sessionId") -/// .current_time_millis("sadipscing") +/// .current_time_millis("dolor") /// .doit(); /// # } /// ``` @@ -3830,7 +4235,7 @@ impl<'a, C, A> UserDataSourcePatchCall<'a, C, A> where C: BorrowMut Engine<'n, 'a> { 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(()) } } @@ -227,6 +228,7 @@ impl<'n, 'a> Engine<'n, 'a> { if !download_mode { } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -287,7 +289,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() @@ -300,7 +302,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() diff --git a/gen/freebase1/Cargo.toml b/gen/freebase1/Cargo.toml index e1a15bf96a..bc73f94557 100644 --- a/gen/freebase1/Cargo.toml +++ b/gen/freebase1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/freebase1/src/cmn.rs b/gen/freebase1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/freebase1/src/cmn.rs +++ b/gen/freebase1/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/freebase1_sandbox-cli/Cargo.toml b/gen/freebase1_sandbox-cli/Cargo.toml index 556579b3de..e99c7b9dfa 100644 --- a/gen/freebase1_sandbox-cli/Cargo.toml +++ b/gen/freebase1_sandbox-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["freebase", "google", "cli"] name = "freebase1-sandbox" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/freebase1_sandbox-cli/src/main.rs b/gen/freebase1_sandbox-cli/src/main.rs index 64e80181bf..860b58f61f 100644 --- a/gen/freebase1_sandbox-cli/src/main.rs +++ b/gen/freebase1_sandbox-cli/src/main.rs @@ -105,6 +105,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -227,6 +228,7 @@ impl<'n, 'a> Engine<'n, 'a> { if !download_mode { } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -287,7 +289,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() @@ -300,7 +302,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() diff --git a/gen/freebase1_sandbox/Cargo.toml b/gen/freebase1_sandbox/Cargo.toml index 4a4e88ed7c..6a0a75032e 100644 --- a/gen/freebase1_sandbox/Cargo.toml +++ b/gen/freebase1_sandbox/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/freebase1_sandbox/src/cmn.rs b/gen/freebase1_sandbox/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/freebase1_sandbox/src/cmn.rs +++ b/gen/freebase1_sandbox/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/fusiontables2-cli/Cargo.toml b/gen/fusiontables2-cli/Cargo.toml index 3adf8e9fd8..d90b03463d 100644 --- a/gen/fusiontables2-cli/Cargo.toml +++ b/gen/fusiontables2-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["fusiontables", "google", "cli"] name = "fusiontables2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/fusiontables2-cli/src/main.rs b/gen/fusiontables2-cli/src/main.rs index 15f9b52534..1d6673697b 100644 --- a/gen/fusiontables2-cli/src/main.rs +++ b/gen/fusiontables2-cli/src/main.rs @@ -133,6 +133,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -229,6 +230,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -287,6 +289,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -383,6 +386,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -479,6 +483,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -542,8 +547,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -608,8 +615,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -708,6 +717,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -828,6 +838,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -886,6 +897,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1007,6 +1019,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1128,6 +1141,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1183,6 +1197,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1278,6 +1293,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1349,6 +1365,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1411,6 +1428,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1506,6 +1524,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1564,6 +1583,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1663,6 +1683,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1734,6 +1755,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1833,6 +1855,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1928,6 +1951,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1989,6 +2013,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2086,6 +2111,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2175,6 +2201,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2233,6 +2260,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2323,6 +2351,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2413,6 +2442,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2605,7 +2635,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() @@ -2618,7 +2648,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() diff --git a/gen/fusiontables2/Cargo.toml b/gen/fusiontables2/Cargo.toml index 339cf9ccc8..5c0cbcbf3a 100644 --- a/gen/fusiontables2/Cargo.toml +++ b/gen/fusiontables2/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/fusiontables2/src/cmn.rs b/gen/fusiontables2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/fusiontables2/src/cmn.rs +++ b/gen/fusiontables2/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/games1-cli/Cargo.toml b/gen/games1-cli/Cargo.toml index 2d85283561..dda6cfe70a 100644 --- a/gen/games1-cli/Cargo.toml +++ b/gen/games1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-games1-cli" -version = "0.3.0+20150413" +version = "0.3.0+20150601" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/games1-cli" @@ -17,8 +17,8 @@ keywords = ["games", "google", "cli"] name = "games1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/games1-cli/README.md b/gen/games1-cli/README.md index f37aad19f6..d9e5eb5533 100644 --- a/gen/games1-cli/README.md +++ b/gen/games1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Games* API at revision *20150413*. The CLI is at version *0.3.0*. +This documentation was generated from the *Games* API at revision *20150601*. The CLI is at version *0.3.0*. ```bash games1 [options] diff --git a/gen/games1-cli/mkdocs.yml b/gen/games1-cli/mkdocs.yml index ee50cf2627..c79b71fabf 100644 --- a/gen/games1-cli/mkdocs.yml +++ b/gen/games1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games v0.3.0+20150413 +site_name: Games v0.3.0+20150601 site_url: http://byron.github.io/google-apis-rs/google-games1-cli site_description: Write integrating applications with bcore diff --git a/gen/games1-cli/src/main.rs b/gen/games1-cli/src/main.rs index 66a7c0064b..1034b5c9da 100644 --- a/gen/games1-cli/src/main.rs +++ b/gen/games1-cli/src/main.rs @@ -99,6 +99,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -155,6 +156,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -219,6 +221,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -270,6 +273,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -322,6 +326,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -373,6 +378,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -457,6 +463,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -515,6 +522,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -620,6 +628,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -681,6 +690,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -771,6 +781,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -826,6 +837,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -887,6 +899,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -938,6 +951,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -999,6 +1013,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1054,6 +1069,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1115,6 +1131,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1375,6 +1392,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1436,6 +1454,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1487,6 +1506,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1592,6 +1612,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1647,6 +1668,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1746,6 +1768,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1844,6 +1867,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1940,6 +1964,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2001,6 +2026,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2089,6 +2115,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2153,6 +2180,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2214,6 +2242,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2281,6 +2310,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2339,6 +2369,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2427,6 +2458,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2482,6 +2514,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2543,6 +2576,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2682,6 +2716,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2737,6 +2772,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2872,6 +2908,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2930,6 +2967,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2985,6 +3023,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3040,6 +3079,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3099,6 +3139,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3166,6 +3207,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3224,6 +3266,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3291,6 +3334,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3383,6 +3427,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3704,7 +3749,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() @@ -3717,7 +3762,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() @@ -4963,7 +5008,7 @@ fn main() { let mut app = App::new("games1") .author("Sebastian Thiel ") - .version("0.3.0+20150413") + .version("0.3.0+20150601") .about("The API for Google Play Game Services.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_games1_cli") .arg(Arg::with_name("url") diff --git a/gen/games1/Cargo.toml b/gen/games1/Cargo.toml index 1ccfb44dc7..e418f5e42a 100644 --- a/gen/games1/Cargo.toml +++ b/gen/games1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-games1" -version = "0.1.8+20150413" +version = "0.1.8+20150601" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/games1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/games1/README.md b/gen/games1/README.md index d138b271fa..d122dada68 100644 --- a/gen/games1/README.md +++ b/gen/games1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-games1` library allows access to all features of the *Google Games* service. -This documentation was generated from *Games* crate version *0.1.8+20150413*, where *20150413* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Games* crate version *0.1.8+20150601*, where *20150601* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *Games* *v1* API can be found at the [official documentation site](https://developers.google.com/games/services/). diff --git a/gen/games1/src/cmn.rs b/gen/games1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/games1/src/cmn.rs +++ b/gen/games1/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/games1/src/lib.rs b/gen/games1/src/lib.rs index 38286464ee..b0db4d16fc 100644 --- a/gen/games1/src/lib.rs +++ b/gen/games1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Games* crate version *0.1.8+20150413*, where *20150413* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Games* crate version *0.1.8+20150601*, where *20150601* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *Games* *v1* API can be found at the //! [official documentation site](https://developers.google.com/games/services/). diff --git a/gen/gamesconfiguration1_configuration-cli/Cargo.toml b/gen/gamesconfiguration1_configuration-cli/Cargo.toml index 6bc3e1eb52..48134fb020 100644 --- a/gen/gamesconfiguration1_configuration-cli/Cargo.toml +++ b/gen/gamesconfiguration1_configuration-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gamesconfiguration1_configuration-cli" -version = "0.3.0+20150413" +version = "0.3.0+20150601" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Configuration (protocol v1configuration)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesconfiguration1_configuration-cli" @@ -17,8 +17,8 @@ keywords = ["gamesConfiguration", "google", "cli"] name = "gamesconfiguration1-configuration" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/gamesconfiguration1_configuration-cli/README.md b/gen/gamesconfiguration1_configuration-cli/README.md index 10e4046a51..6e3b289b71 100644 --- a/gen/gamesconfiguration1_configuration-cli/README.md +++ b/gen/gamesconfiguration1_configuration-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Games Configuration* API at revision *20150413*. The CLI is at version *0.3.0*. +This documentation was generated from the *Games Configuration* API at revision *20150601*. The CLI is at version *0.3.0*. ```bash gamesconfiguration1-configuration [options] diff --git a/gen/gamesconfiguration1_configuration-cli/mkdocs.yml b/gen/gamesconfiguration1_configuration-cli/mkdocs.yml index c678ee8580..66380a0938 100644 --- a/gen/gamesconfiguration1_configuration-cli/mkdocs.yml +++ b/gen/gamesconfiguration1_configuration-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games Configuration v0.3.0+20150413 +site_name: Games Configuration v0.3.0+20150601 site_url: http://byron.github.io/google-apis-rs/google-gamesconfiguration1_configuration-cli site_description: Write integrating applications with bcore diff --git a/gen/gamesconfiguration1_configuration-cli/src/main.rs b/gen/gamesconfiguration1_configuration-cli/src/main.rs index ab137ac7b8..0476ddf9b9 100644 --- a/gen/gamesconfiguration1_configuration-cli/src/main.rs +++ b/gen/gamesconfiguration1_configuration-cli/src/main.rs @@ -133,6 +133,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -234,6 +235,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -292,6 +294,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -393,6 +396,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -494,6 +498,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -549,6 +554,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -644,6 +650,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -759,6 +766,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -817,6 +825,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -932,6 +941,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1047,6 +1057,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1155,7 +1166,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() @@ -1168,7 +1179,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() @@ -1539,7 +1550,7 @@ fn main() { let mut app = App::new("gamesconfiguration1-configuration") .author("Sebastian Thiel ") - .version("0.3.0+20150413") + .version("0.3.0+20150601") .about("The Publishing API for Google Play Game Services.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_gamesconfiguration1_configuration_cli") .arg(Arg::with_name("url") diff --git a/gen/gamesconfiguration1_configuration/Cargo.toml b/gen/gamesconfiguration1_configuration/Cargo.toml index 30f32141ec..1693769518 100644 --- a/gen/gamesconfiguration1_configuration/Cargo.toml +++ b/gen/gamesconfiguration1_configuration/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gamesconfiguration1_configuration" -version = "0.1.8+20150413" +version = "0.1.8+20150601" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Configuration (protocol v1configuration)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesconfiguration1_configuration" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/gamesconfiguration1_configuration/README.md b/gen/gamesconfiguration1_configuration/README.md index 537bf9cc41..7a8dfa8f38 100644 --- a/gen/gamesconfiguration1_configuration/README.md +++ b/gen/gamesconfiguration1_configuration/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-gamesconfiguration1_configuration` library allows access to all features of the *Google Games Configuration* service. -This documentation was generated from *Games Configuration* crate version *0.1.8+20150413*, where *20150413* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Games Configuration* crate version *0.1.8+20150601*, where *20150601* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *Games Configuration* *v1_configuration* API can be found at the [official documentation site](https://developers.google.com/games/services). diff --git a/gen/gamesconfiguration1_configuration/src/cmn.rs b/gen/gamesconfiguration1_configuration/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/gamesconfiguration1_configuration/src/cmn.rs +++ b/gen/gamesconfiguration1_configuration/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/gamesconfiguration1_configuration/src/lib.rs b/gen/gamesconfiguration1_configuration/src/lib.rs index 660b7a6089..e5aa67fb48 100644 --- a/gen/gamesconfiguration1_configuration/src/lib.rs +++ b/gen/gamesconfiguration1_configuration/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Games Configuration* crate version *0.1.8+20150413*, where *20150413* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Games Configuration* crate version *0.1.8+20150601*, where *20150601* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *Games Configuration* *v1_configuration* API can be found at the //! [official documentation site](https://developers.google.com/games/services). diff --git a/gen/gamesmanagement1_management-cli/Cargo.toml b/gen/gamesmanagement1_management-cli/Cargo.toml index e1fa50990c..588e8c61bd 100644 --- a/gen/gamesmanagement1_management-cli/Cargo.toml +++ b/gen/gamesmanagement1_management-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gamesmanagement1_management-cli" -version = "0.3.0+20150413" +version = "0.3.0+20150601" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Management (protocol v1management)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesmanagement1_management-cli" @@ -17,8 +17,8 @@ keywords = ["gamesManagement", "google", "cli"] name = "gamesmanagement1-management" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/gamesmanagement1_management-cli/README.md b/gen/gamesmanagement1_management-cli/README.md index 16127dfbbd..13db15aa0d 100644 --- a/gen/gamesmanagement1_management-cli/README.md +++ b/gen/gamesmanagement1_management-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Games Management* API at revision *20150413*. The CLI is at version *0.3.0*. +This documentation was generated from the *Games Management* API at revision *20150601*. The CLI is at version *0.3.0*. ```bash gamesmanagement1-management [options] diff --git a/gen/gamesmanagement1_management-cli/mkdocs.yml b/gen/gamesmanagement1_management-cli/mkdocs.yml index e9d2058804..9cc36974b7 100644 --- a/gen/gamesmanagement1_management-cli/mkdocs.yml +++ b/gen/gamesmanagement1_management-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games Management v0.3.0+20150413 +site_name: Games Management v0.3.0+20150601 site_url: http://byron.github.io/google-apis-rs/google-gamesmanagement1_management-cli site_description: Write integrating applications with bcore diff --git a/gen/gamesmanagement1_management-cli/src/main.rs b/gen/gamesmanagement1_management-cli/src/main.rs index 6a2035e907..4de671f3b0 100644 --- a/gen/gamesmanagement1_management-cli/src/main.rs +++ b/gen/gamesmanagement1_management-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -140,6 +141,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -364,6 +366,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1099,6 +1102,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1150,6 +1154,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1594,7 +1599,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() @@ -1607,7 +1612,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() @@ -2072,7 +2077,7 @@ fn main() { let mut app = App::new("gamesmanagement1-management") .author("Sebastian Thiel ") - .version("0.3.0+20150413") + .version("0.3.0+20150601") .about("The Management API for Google Play Game Services.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_gamesmanagement1_management_cli") .arg(Arg::with_name("url") diff --git a/gen/gamesmanagement1_management/Cargo.toml b/gen/gamesmanagement1_management/Cargo.toml index d6ace38160..ff29701e2c 100644 --- a/gen/gamesmanagement1_management/Cargo.toml +++ b/gen/gamesmanagement1_management/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gamesmanagement1_management" -version = "0.1.8+20150413" +version = "0.1.8+20150601" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Management (protocol v1management)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesmanagement1_management" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/gamesmanagement1_management/README.md b/gen/gamesmanagement1_management/README.md index ad8b232260..8c6945e475 100644 --- a/gen/gamesmanagement1_management/README.md +++ b/gen/gamesmanagement1_management/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-gamesmanagement1_management` library allows access to all features of the *Google Games Management* service. -This documentation was generated from *Games Management* crate version *0.1.8+20150413*, where *20150413* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Games Management* crate version *0.1.8+20150601*, where *20150601* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *Games Management* *v1_management* API can be found at the [official documentation site](https://developers.google.com/games/services). diff --git a/gen/gamesmanagement1_management/src/cmn.rs b/gen/gamesmanagement1_management/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/gamesmanagement1_management/src/cmn.rs +++ b/gen/gamesmanagement1_management/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/gamesmanagement1_management/src/lib.rs b/gen/gamesmanagement1_management/src/lib.rs index 0f76259c2c..d2adf0cf9b 100644 --- a/gen/gamesmanagement1_management/src/lib.rs +++ b/gen/gamesmanagement1_management/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Games Management* crate version *0.1.8+20150413*, where *20150413* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Games Management* crate version *0.1.8+20150601*, where *20150601* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *Games Management* *v1_management* API can be found at the //! [official documentation site](https://developers.google.com/games/services). diff --git a/gen/gan1_beta1-cli/Cargo.toml b/gen/gan1_beta1-cli/Cargo.toml index 1d68e31541..88d339d24d 100644 --- a/gen/gan1_beta1-cli/Cargo.toml +++ b/gen/gan1_beta1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["gan", "google", "cli"] name = "gan1-beta1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/gan1_beta1-cli/src/main.rs b/gen/gan1_beta1-cli/src/main.rs index 4d54c72997..9ba7931a8a 100644 --- a/gen/gan1_beta1-cli/src/main.rs +++ b/gen/gan1_beta1-cli/src/main.rs @@ -90,6 +90,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -160,6 +161,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -215,6 +217,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -312,6 +315,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -360,6 +364,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -474,6 +479,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -562,6 +568,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -614,6 +621,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -684,6 +692,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -766,6 +775,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -889,7 +899,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() @@ -902,7 +912,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() diff --git a/gen/gan1_beta1/Cargo.toml b/gen/gan1_beta1/Cargo.toml index 11ae5e6dde..94413c0294 100644 --- a/gen/gan1_beta1/Cargo.toml +++ b/gen/gan1_beta1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/gan1_beta1/src/cmn.rs b/gen/gan1_beta1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/gan1_beta1/src/cmn.rs +++ b/gen/gan1_beta1/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-cli/Cargo.toml b/gen/genomics1-cli/Cargo.toml new file mode 100644 index 0000000000..cc5eaf8e5e --- /dev/null +++ b/gen/genomics1-cli/Cargo.toml @@ -0,0 +1,33 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-genomics1-cli" +version = "0.3.0+20150615" +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" +documentation = "http://byron.github.io/google-apis-rs/google_genomics1_cli" +license = "MIT" +keywords = ["genomics", "google", "cli"] + +[[bin]] +name = "genomics1" + +[dependencies] +hyper = ">= 0.5.2" +mime = "0.0.11" +serde = ">= 0.4.1" +yup-oauth2 = "*" +strsim = "*" +yup-hyper-mock = ">=1.0.0" +clap = ">= 0.9.1" + +[build-dependencies] +syntex = { version = "*" } +serde_codegen = { version = "*" } + + +[dependencies.google-genomics1] +path = "../genomics1" diff --git a/gen/genomics1-cli/LICENSE.md b/gen/genomics1-cli/LICENSE.md new file mode 100644 index 0000000000..ae22e6ec52 --- /dev/null +++ b/gen/genomics1-cli/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015` `Sebastian Thiel` + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the “Software”), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/gen/genomics1-cli/README.md b/gen/genomics1-cli/README.md new file mode 100644 index 0000000000..f699748a88 --- /dev/null +++ b/gen/genomics1-cli/README.md @@ -0,0 +1,104 @@ + +The `genomics1` command-line interface *(CLI)* allows to use most features of the *Google genomics* service from the comfort of your terminal. + +By default all output is printed to standard out, but flags can be set to direct it into a file independent of your shell's +capabilities. Errors will be printed to standard error, and cause the program's exit code to be non-zero. + +If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. + +# Downloads + +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) + +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*. + +```bash +genomics1 [options] + genomics1 --help + +Configuration: + --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. + [default: ~/.google-service-cli] + --debug + Output all server communication to standard error. `tx` and `rx` are placed + into the same stream. + --debug-auth + Output all communication related to authentication to standard error. `tx` + and `rx` are placed into the same stream. + +``` + +# Configuration + +The program will store all persistent data in the `~/.google-service-cli` directory in *JSON* files prefixed with `genomics1-`. You can change the directory used to store configuration with the `--config-dir` flag on a per-invocation basis. + +More information about the various kinds of persistent data are given in the following paragraphs. + +# Authentication + +Most APIs require a user to authenticate any request. If this is the case, the [scope][scopes] determines the +set of permissions granted. The granularity of these is usually no more than *read-only* or *full-access*. + +If not set, the system will automatically select the smallest feasible scope, e.g. when invoking a +method that is read-only, it will ask only for a read-only scope. +You may use the `--scope` flag to specify a scope directly. +All applicable scopes are documented in the respective method's CLI documentation. + +The first time a scope is used, the user is asked for permission. Follow the instructions given +by the CLI to grant permissions, or to decline. + +If a scope was authenticated by the user, the respective information will be stored as *JSON* in the configuration +directory, e.g. `~/.google-service-cli/genomics1-token-.json`. No manual management of these tokens +is necessary. + +To revoke granted authentication, please refer to the [official documentation][revoke-access]. + +# Application Secrets + +In order to allow any application to use Google services, it will need to be registered using the +[Google Developer Console][google-dev-console]. APIs the application may use are then enabled for it +one by one. Most APIs can be used for free and have a daily quota. + +To allow more comfortable usage of the CLI without forcing anyone to register an own application, the CLI +comes with a default application secret that is configured accordingly. This also means that heavy usage +all around the world may deplete the daily quota. + +You can workaround this limitation by putting your own secrets file at this location: +`~/.google-service-cli/genomics1-secret.json`, assuming that the required *genomics* API +was enabled for it. Such a secret file can be downloaded in the *Google Developer Console* at +*APIs & auth -> Credentials -> Download JSON* and used as is. + +Learn more about how to setup Google projects and enable APIs using the [official documentation][google-project-new]. + + +# Debugging + +Even though the CLI does its best to provide usable error messages, sometimes it might be desirable to know +what exactly led to a particular issue. This is done by allowing all client-server communication to be +output to standard error *as-is*. + +The `--debug` flag will print all client-server communication to standard error, whereas the `--debug-auth` flag +will cause all communication related to authentication to standard error. +If the `--debug` flag is set, error-results will be debug-printed, possibly yielding more information about the +issue at hand. + +You may consider redirecting standard error into a file for ease of use, e.g. `genomics1 --debug [options] 2>debug.txt`. + + +[scopes]: https://developers.google.com/+/api/oauth#scopes +[revoke-access]: http://webapps.stackexchange.com/a/30849 +[google-dev-console]: https://console.developers.google.com/ +[google-project-new]: https://developers.google.com/console/help/new/ \ No newline at end of file diff --git a/gen/genomics1-cli/mkdocs.yml b/gen/genomics1-cli/mkdocs.yml new file mode 100644 index 0000000000..b37d5e4ec1 --- /dev/null +++ b/gen/genomics1-cli/mkdocs.yml @@ -0,0 +1,16 @@ +site_name: genomics v0.3.0+20150615 +site_url: http://byron.github.io/google-apis-rs/google-genomics1-cli +site_description: Write integrating applications with bcore + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/genomics1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] + +theme: readthedocs + +copyright: Copyright © 2015, `Sebastian Thiel` + diff --git a/gen/genomics1-cli/src/cmn.rs b/gen/genomics1-cli/src/cmn.rs new file mode 100644 index 0000000000..56051cab08 --- /dev/null +++ b/gen/genomics1-cli/src/cmn.rs @@ -0,0 +1,718 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde::json; +use serde::json::value::Value; +use mime::Mime; +use clap::{App, SubCommand}; +use strsim; + +use std::fs; +use std::env; +use std::io; +use std::fmt; +use std::path::{Path, PathBuf}; +use std::str::FromStr; +use std::string::ToString; +use std::io::{Write, Read, stdout}; + +use std::default::Default; + +const FIELD_SEP: char = '.'; + + +pub enum ComplexType { + Pod, + Vec, + Map, +} + + // Null, + // Bool(bool), + // I64(i64), + // U64(u64), + // F64(f64), + // String(String), + +pub enum JsonType { + Boolean, + Int, + Uint, + Float, + String, +} + +pub struct JsonTypeInfo { + pub jtype: JsonType, + pub ctype: ComplexType, +} + +// Based on @erickt user comment. Thanks for the idea ! +// Remove all keys whose values are null from given value (changed in place) +pub fn remove_json_null_values(value: &mut Value) { + match *value { + Value::Object(ref mut map) => { + let mut for_removal = Vec::new(); + + for (key, mut value) in map.iter_mut() { + if value.is_null() { + for_removal.push(key.clone()); + } else { + remove_json_null_values(&mut value); + } + } + + for key in &for_removal { + map.remove(key); + } + } + _ => {} + } +} + +fn did_you_mean<'a>(v: &str, possible_values: &[&'a str]) -> Option<&'a str> { + + let mut candidate: Option<(f64, &str)> = None; + for pv in possible_values { + let confidence = strsim::jaro_winkler(v, pv); + if confidence > 0.8 && (candidate.is_none() || (candidate.as_ref().unwrap().0 < confidence)) { + candidate = Some((confidence, pv)); + } + } + match candidate { + None => None, + Some((_, candidate)) => Some(candidate), + } +} + +pub enum CallType { + Upload(UploadProtocol), + Standard, +} + +arg_enum!{ + pub enum UploadProtocol { + Simple, + Resumable + } +} + +impl AsRef for UploadProtocol { + fn as_ref(&self) -> &str { + match *self { + UploadProtocol::Simple => "simple", + UploadProtocol::Resumable => "resumable" + } + } +} + +impl AsRef for CallType { + fn as_ref(&self) -> &str { + match *self { + CallType::Upload(ref proto) => proto.as_ref(), + CallType::Standard => "standard-request" + } + } +} + +#[derive(Clone, Default)] +pub struct FieldCursor(Vec); + +impl ToString for FieldCursor { + fn to_string(&self) -> String { + self.0.connect(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +impl FieldCursor { + pub fn set(&mut self, value: &str) -> Result<(), CLIError> { + if value.len() == 0 { + return Err(CLIError::Field(FieldError::Empty)) + } + + let mut first_is_field_sep = false; + let mut char_count: usize = 0; + let mut last_c = FIELD_SEP; + let mut num_conscutive_field_seps = 0; + + let mut field = String::new(); + let mut fields = self.0.clone(); + + let push_field = |fs: &mut Vec, f: &mut String| { + if f.len() > 0 { + fs.push(f.clone()); + f.truncate(0); + } + }; + + for (cid, c) in value.chars().enumerate() { + char_count += 1; + + if c == FIELD_SEP { + if cid == 0 { + first_is_field_sep = true; + } + num_conscutive_field_seps += 1; + if cid > 0 && last_c == FIELD_SEP { + if fields.pop().is_none() { + return Err(CLIError::Field(FieldError::PopOnEmpty(value.to_string()))) + } + } else { + push_field(&mut fields, &mut field); + } + } else { + num_conscutive_field_seps = 0; + if cid == 1 { + if first_is_field_sep { + fields.truncate(0); + } + } + field.push(c); + } + + last_c = c; + } + + push_field(&mut fields, &mut field); + + if char_count == 1 && first_is_field_sep { + fields.truncate(0); + } + if char_count > 1 && num_conscutive_field_seps == 1 { + return Err(CLIError::Field(FieldError::TrailingFieldSep(value.to_string()))) + } + + self.0 = fields; + Ok(()) + } + + pub fn did_you_mean(value: &str, possible_values: &[&str]) -> Option { + if value.len() == 0 { + return None + } + + let mut last_c = FIELD_SEP; + + let mut field = String::new(); + let mut output = String::new(); + + let push_field = |fs: &mut String, f: &mut String| { + if f.len() > 0 { + fs.push_str( + match did_you_mean(&f, possible_values) { + Some(candidate) => candidate, + None => &f, + }); + f.truncate(0); + } + }; + + for (cid, c) in value.chars().enumerate() { + if c == FIELD_SEP { + if last_c != FIELD_SEP { + push_field(&mut output, &mut field); + } + output.push(c); + } else { + field.push(c); + } + + last_c = c; + } + + push_field(&mut output, &mut field); + + if &output == value { + None + } else { + Some(output) + } + } + + pub fn set_json_value(&self, mut object: &mut Value, + value: &str, type_info: JsonTypeInfo, + err: &mut InvalidOptionsError, + orig_cursor: &FieldCursor) { + assert!(self.0.len() > 0); + + for field in &self.0[..self.0.len()-1] { + let tmp = object; + object = + match *tmp { + Value::Object(ref mut mapping) => { + mapping.entry(field.to_owned()).or_insert( + Value::Object(Default::default()) + ) + }, + _ => panic!("We don't expect non-object Values here ...") + }; + } + + match *object { + Value::Object(ref mut mapping) => { + let field = &self.0[self.0.len()-1]; + let to_jval = + |value: &str, jtype: JsonType, err: &mut InvalidOptionsError| + -> Value { + match jtype { + JsonType::Boolean => + Value::Bool(arg_from_str(value, err, &field, "boolean")), + JsonType::Int => + Value::I64(arg_from_str(value, err, &field, "int")), + JsonType::Uint => + Value::U64(arg_from_str(value, err, &field, "uint")), + JsonType::Float => + Value::F64(arg_from_str(value, err, &field, "float")), + JsonType::String => + Value::String(value.to_owned()), + } + }; + + match type_info.ctype { + ComplexType::Pod => { + if mapping.insert(field.to_owned(), to_jval(value, type_info.jtype, err)).is_some() { + err.issues.push(CLIError::Field(FieldError::Duplicate(orig_cursor.to_string()))); + } + }, + ComplexType::Vec => { + match *mapping.entry(field.to_owned()) + .or_insert(Value::Array(Default::default())) { + Value::Array(ref mut values) => values.push(to_jval(value, type_info.jtype, err)), + _ => unreachable!() + } + }, + ComplexType::Map => { + let (key, value) = parse_kv_arg(value, err, true); + let jval = to_jval(value.unwrap_or(""), type_info.jtype, err); + + match *mapping.entry(field.to_owned()) + .or_insert(Value::Object(Default::default())) { + Value::Object(ref mut value_map) => { + if value_map.insert(key.to_owned(), jval).is_some() { + err.issues.push(CLIError::Field(FieldError::Duplicate(orig_cursor.to_string()))); + } + } + _ => unreachable!() + } + } + } + }, + _ => unreachable!() + } + } + + pub fn num_fields(&self) -> usize { + self.0.len() + } +} + +pub fn parse_kv_arg<'a>(kv: &'a str, err: &mut InvalidOptionsError, for_hashmap: bool) + -> (&'a str, Option<&'a str>) { + let mut add_err = || err.issues.push(CLIError::InvalidKeyValueSyntax(kv.to_string(),for_hashmap)); + match kv.find('=') { + None => { + add_err(); + return (kv, None) + }, + Some(pos) => { + let key = &kv[..pos]; + if kv.len() <= pos + 1 { + add_err(); + return (key, Some("")) + } + (key, Some(&kv[pos+1..])) + } + } +} + +pub fn calltype_from_str(name: &str, valid_protocols: Vec, err: &mut InvalidOptionsError) -> CallType { + CallType::Upload( + match UploadProtocol::from_str(name) { + Ok(up) => up, + Err(msg) => { + err.issues.push(CLIError::InvalidUploadProtocol(name.to_string(), valid_protocols)); + UploadProtocol::Simple + } + }) +} + +pub fn input_file_from_opts(file_path: &str, err: &mut InvalidOptionsError) -> Option { + match fs::File::open(file_path) { + Ok(f) => Some(f), + Err(io_err) => { + err.issues.push(CLIError::Input(InputError::IOError((file_path.to_string(), io_err)))); + None + } + } +} + +pub fn input_mime_from_opts(mime: &str, err: &mut InvalidOptionsError) -> Option { + match mime.parse() { + Ok(m) => Some(m), + Err(_) => { + err.issues.push(CLIError::Input(InputError::Mime(mime.to_string()))); + None + } + } +} + +pub fn writer_from_opts(arg: Option<&str>) -> Result, io::Error> { + let f = arg.unwrap_or("-"); + match f { + "-" => Ok(Box::new(stdout())), + _ => match fs::OpenOptions::new().create(true).write(true).open(f) { + Ok(f) => Ok(Box::new(f)), + Err(io_err) => Err(io_err), + } + } +} + + +pub fn arg_from_str<'a, T>(arg: &str, err: &mut InvalidOptionsError, + arg_name: &'a str, + arg_type: &'a str) -> T + where T: FromStr + Default, + ::Err: fmt::Display { + match FromStr::from_str(arg) { + Err(perr) => { + err.issues.push( + CLIError::ParseError(arg_name.to_owned(), arg_type.to_owned(), arg.to_string(), format!("{}", perr)) + ); + Default::default() + }, + Ok(v) => v, + } +} + +pub struct JsonTokenStorage { + pub program_name: &'static str, + pub db_dir: String, +} + +impl JsonTokenStorage { + fn path(&self, scope_hash: u64) -> PathBuf { + Path::new(&self.db_dir).join(&format!("{}-token-{}.json", self.program_name, scope_hash)) + } +} + +impl TokenStorage for JsonTokenStorage { + type Error = json::Error; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, scope_hash: u64, _: &Vec<&str>, token: Option) -> Result<(), json::Error> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => + match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(json::Error::IoError(err)) + }, + Ok(_) => Ok(()), + } + } + Some(token) => { + match fs::OpenOptions::new().create(true).write(true).open(&self.path(scope_hash)) { + Ok(mut f) => { + match json::to_writer_pretty(&mut f, &token) { + Ok(_) => Ok(()), + Err(io_err) => Err(json::Error::IoError(io_err)), + } + }, + Err(io_err) => Err(json::Error::IoError(io_err)) + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, json::Error> { + match fs::File::open(&self.path(scope_hash)) { + Ok(mut f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(err), + } + }, + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(json::Error::IoError(io_err)) + } + } + } + } +} + + +#[derive(Debug)] +pub enum ApplicationSecretError { + DecoderError((String, json::Error)), + FormatError(String), +} + +impl fmt::Display for ApplicationSecretError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + ApplicationSecretError::DecoderError((ref path, ref err)) + => writeln!(f, "Could not decode file at '{}' with error: {}.", + path, err), + ApplicationSecretError::FormatError(ref path) + => writeln!(f, "'installed' field is unset in secret file at '{}'.", + path), + } + } +} + +#[derive(Debug)] +pub enum ConfigurationError { + DirectoryCreationFailed((String, io::Error)), + DirectoryUnset, + HomeExpansionFailed(String), + Secret(ApplicationSecretError), + IOError((String, io::Error)), +} + +impl fmt::Display for ConfigurationError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + ConfigurationError::DirectoryCreationFailed((ref dir, ref err)) + => writeln!(f, "Directory '{}' could not be created with error: {}.", dir, err), + ConfigurationError::DirectoryUnset + => writeln!(f, "--config-dir was unset or empty."), + ConfigurationError::HomeExpansionFailed(ref dir) + => writeln!(f, "Couldn't find HOME directory of current user, failed to expand '{}'.", dir), + ConfigurationError::Secret(ref err) + => writeln!(f, "Secret -> {}", err), + ConfigurationError::IOError((ref path, ref err)) + => writeln!(f, "IO operation failed on path '{}' with error: {}.", path, err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + IOError((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::IOError((ref file_path, ref io_err)) + => writeln!(f, "Failed to open '{}' for reading with error: {}.", file_path, io_err), + InputError::Mime(ref mime) + => writeln!(f, "'{}' is not a known mime-type.", mime), + } + } +} + +#[derive(Debug)] +pub enum FieldError { + PopOnEmpty(String), + TrailingFieldSep(String), + Unknown(String, Option, Option), + Duplicate(String), + Empty, +} + + +impl fmt::Display for FieldError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + FieldError::PopOnEmpty(ref field) + => writeln!(f, "'{}': Cannot move up on empty field cursor.", field), + FieldError::TrailingFieldSep(ref field) + => writeln!(f, "'{}': Single field separator may not be last character.", field), + FieldError::Unknown(ref field, ref suggestion, ref value) => { + let suffix = + match *suggestion { + Some(ref s) => { + let kv = + match *value { + Some(ref v) => format!("{}={}", s, v), + None => s.clone(), + }; + format!(" Did you mean '{}' ?", kv) + }, + None => String::new(), + }; + writeln!(f, "Field '{}' does not exist.{}", field, suffix) + }, + FieldError::Duplicate(ref cursor) + => writeln!(f, "Value at '{}' was already set", cursor), + FieldError::Empty + => writeln!(f, "Field names must not be empty."), + } + } +} + + +#[derive(Debug)] +pub enum CLIError { + Configuration(ConfigurationError), + ParseError(String, String, String, String), + UnknownParameter(String, Vec<&'static str>), + InvalidUploadProtocol(String, Vec), + InvalidKeyValueSyntax(String, bool), + Input(InputError), + Field(FieldError), + MissingCommandError, + MissingMethodError(String), +} + +impl fmt::Display for CLIError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + CLIError::Configuration(ref err) => write!(f, "Configuration -> {}", err), + CLIError::Input(ref err) => write!(f, "Input -> {}", err), + CLIError::Field(ref err) => write!(f, "Field -> {}", err), + CLIError::InvalidUploadProtocol(ref proto_name, ref valid_names) + => writeln!(f, "'{}' is not a valid upload protocol. Choose from one of {}.", proto_name, valid_names.connect(", ")), + CLIError::ParseError(ref arg_name, ref type_name, ref value, ref err_desc) + => writeln!(f, "Failed to parse argument '{}' with value '{}' as {} with error: {}.", + arg_name, value, type_name, err_desc), + CLIError::UnknownParameter(ref param_name, ref possible_values) => { + let mut suffix = + match did_you_mean(param_name, &possible_values) { + Some(v) => format!(" Did you mean '{}' ?", v), + None => String::new(), + }; + write!(f, "Parameter '{}' is unknown.{}\n", param_name, suffix) + }, + CLIError::InvalidKeyValueSyntax(ref kv, is_hashmap) => { + let hashmap_info = if is_hashmap { "hashmap " } else { "" }; + writeln!(f, "'{}' does not match {}pattern =.", kv, hashmap_info) + }, + CLIError::MissingCommandError => writeln!(f, "Please specify the main sub-command."), + CLIError::MissingMethodError(ref cmd) => writeln!(f, "Please specify the method to call on the '{}' command.", cmd), + } + } +} + +#[derive(Debug)] +pub struct InvalidOptionsError { + pub issues: Vec, + pub exit_code: i32, +} + +impl fmt::Display for InvalidOptionsError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + for issue in &self.issues { + try!(issue.fmt(f)); + } + Ok(()) + } +} + +impl InvalidOptionsError { + pub fn single(err: CLIError, exit_code: i32) -> InvalidOptionsError { + InvalidOptionsError { + issues: vec![err], + exit_code: exit_code, + } + } + + pub fn new() -> InvalidOptionsError { + InvalidOptionsError { + issues: Vec::new(), + exit_code: 1, + } + } +} + +pub fn assure_config_dir_exists(dir: &str) -> Result { + let trdir = dir.trim(); + if trdir.len() == 0 { + return Err(CLIError::Configuration(ConfigurationError::DirectoryUnset)) + } + + let expanded_config_dir = + if trdir.as_bytes()[0] == b'~' { + match env::var("HOME").ok().or(env::var("UserProfile").ok()) { + None => return Err(CLIError::Configuration(ConfigurationError::HomeExpansionFailed(trdir.to_string()))), + Some(mut user) => { + user.push_str(&trdir[1..]); + user + } + } + } else { + trdir.to_string() + }; + + if let Err(err) = fs::create_dir(&expanded_config_dir) { + if err.kind() != io::ErrorKind::AlreadyExists { + return Err(CLIError::Configuration( + ConfigurationError::DirectoryCreationFailed((expanded_config_dir, err)))) + } + } + + Ok(expanded_config_dir) +} + +pub fn application_secret_from_directory(dir: &str, + secret_basename: &str, + json_console_secret: &str) + -> Result { + let secret_path = Path::new(dir).join(secret_basename); + let secret_str = || secret_path.as_path().to_str().unwrap().to_string(); + let secret_io_error = |io_err: io::Error| { + Err(CLIError::Configuration(ConfigurationError::IOError( + (secret_str(), io_err) + ))) + }; + + for _ in 0..2 { + match fs::File::open(&secret_path) { + Err(mut err) => { + if err.kind() == io::ErrorKind::NotFound { + // Write our built-in one - user may adjust the written file at will + + err = match fs::OpenOptions::new().create(true).write(true).open(&secret_path) { + Err(cfe) => cfe, + Ok(mut f) => { + // Assure we convert 'ugly' json string into pretty one + let console_secret: ConsoleApplicationSecret + = json::from_str(json_console_secret).unwrap(); + match json::to_writer_pretty(&mut f, &console_secret) { + Err(io_err) => io_err, + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err) + }, + Ok(mut f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + Err(json::Error::IoError(err)) => + return secret_io_error(err), + Err(json_err) => + return Err(CLIError::Configuration( + ConfigurationError::Secret( + ApplicationSecretError::DecoderError( + (secret_str(), json_err) + )))), + Ok(console_secret) => + match console_secret.installed { + Some(secret) => return Ok(secret), + None => return Err( + CLIError::Configuration( + ConfigurationError::Secret( + ApplicationSecretError::FormatError(secret_str()) + ))) + }, + } + } + } + } + unreachable!(); +} \ No newline at end of file diff --git a/gen/genomics1-cli/src/main.rs b/gen/genomics1-cli/src/main.rs new file mode 100644 index 0000000000..0852020f4b --- /dev/null +++ b/gen/genomics1-cli/src/main.rs @@ -0,0 +1,230 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/cli/main.rs.mako' +// DO NOT EDIT ! +#![allow(unused_variables, unused_imports, dead_code, unused_mut)] + +#[macro_use] +extern crate clap; +extern crate yup_oauth2 as oauth2; +extern crate yup_hyper_mock as mock; +extern crate serde; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_genomics1 as api; + +use std::env; +use std::io::{self, Write}; +use clap::{App, SubCommand, Arg}; + +mod cmn; + +use cmn::{InvalidOptionsError, CLIError, JsonTokenStorage, arg_from_str, writer_from_opts, parse_kv_arg, + input_file_from_opts, input_mime_from_opts, FieldCursor, FieldError, CallType, UploadProtocol, + calltype_from_str, remove_json_null_values, ComplexType, JsonType, JsonTypeInfo}; + +use std::default::Default; +use std::str::FromStr; + +use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; +use serde::json; +use clap::ArgMatches; + +enum DoitError { + IoError(String, io::Error), + ApiError(api::Error), +} + +struct Engine<'n, 'a> { + opt: ArgMatches<'n, 'a>, + hub: api::Genomics>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n, 'a> Engine<'n, 'a> { + 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() { + _ => { + err.issues.push(CLIError::MissingCommandError); + writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); + } + } + + if dry_run { + if err.issues.len() > 0 { + err_opt = Some(err); + } + Err(err_opt) + } else { + Ok(call_result) + } + } + + // Please note that this call will fail if any part of the opt can't be handled + fn new(opt: ArgMatches<'a, 'n>) -> Result, InvalidOptionsError> { + let (config_dir, secret) = { + let config_dir = match cmn::assure_config_dir_exists(opt.value_of("folder").unwrap_or("~/.google-service-cli")) { + Err(e) => return Err(InvalidOptionsError::single(e, 3)), + Ok(p) => p, + }; + + match cmn::application_secret_from_directory(&config_dir, "genomics1-secret.json", + "{\"installed\":{\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_secret\":\"hCsslbCUyfehWMmbkG8vTYxG\",\"token_uri\":\"https://accounts.google.com/o/oauth2/token\",\"client_email\":\"\",\"redirect_uris\":[\"urn:ietf:wg:oauth:2.0:oob\",\"oob\"],\"client_x509_cert_url\":\"\",\"client_id\":\"620010449518-9ngf7o4dhs0dka470npqvor6dc5lqb9b.apps.googleusercontent.com\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\"}}") { + Ok(secret) => (config_dir, secret), + Err(e) => return Err(InvalidOptionsError::single(e, 4)) + } + }; + + let auth = Authenticator::new( &secret, DefaultAuthenticatorDelegate, + if opt.is_present("debug-auth") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpConnector(None) + }) + } else { + hyper::Client::new() + }, + JsonTokenStorage { + program_name: "genomics1", + db_dir: config_dir.clone(), + }, None); + + let client = + if opt.is_present("debug") { + hyper::Client::with_connector(mock::TeeConnector { + connector: hyper::net::HttpConnector(None) + }) + } else { + hyper::Client::new() + }; + let engine = Engine { + opt: opt, + hub: api::Genomics::new(client, auth), + gp: vec!["$-xgafv", "access-token", "alt", "bearer-token", "callback", "fields", "key", "oauth-token", "pp", "pretty-print", "quota-user", "upload-type", "upload-protocol"], + gpm: vec![ + ("$-xgafv", "$.xgafv"), + ("access-token", "access_token"), + ("bearer-token", "bearer_token"), + ("oauth-token", "oauth_token"), + ("pretty-print", "prettyPrint"), + ("quota-user", "quotaUser"), + ("upload-type", "uploadType"), + ("upload-protocol", "upload_protocol"), + ] + }; + + match engine._doit(true) { + Err(Some(err)) => Err(err), + Err(None) => Ok(engine), + Ok(_) => unreachable!(), + } + } + + fn doit(&self) -> Result<(), DoitError> { + match self._doit(false) { + Ok(res) => res, + Err(_) => unreachable!(), + } + } +} + +fn main() { + let mut exit_status = 0i32; + let arg_data = [ + ]; + + let mut app = App::new("genomics1") + .author("Sebastian Thiel ") + .version("0.3.0+20150615") + .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("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") + .multiple(false) + .takes_value(true)) + .arg(Arg::with_name("debug") + .long("debug") + .help("Output all server communication to standard error. `tx` and `rx` are placed into the same stream.") + .multiple(false) + .takes_value(false)) + .arg(Arg::with_name("debug-auth") + .long("debug-auth") + .help("Output all communication related to authentication to standard error. `tx` and `rx` are placed into the same stream.") + .multiple(false) + .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); + + for &(sub_command_name, ref desc, url_info, ref args) in subcommands { + let mut scmd = SubCommand::new(sub_command_name); + if let &Some(desc) = desc { + scmd = scmd.about(desc); + } + scmd = scmd.after_help(url_info); + + for &(ref arg_name, ref flag, ref desc, ref required, ref multi) in args { + let arg_name_str = + match (arg_name, flag) { + (&Some(an), _ ) => an, + (_ , &Some(f)) => f, + _ => unreachable!(), + }; + let mut arg = Arg::with_name(arg_name_str) + .empty_values(false); + if let &Some(short_flag) = flag { + arg = arg.short(short_flag); + } + if let &Some(desc) = desc { + arg = arg.help(desc); + } + if arg_name.is_some() && flag.is_some() { + arg = arg.takes_value(true); + } + if let &Some(required) = required { + arg = arg.required(required); + } + if let &Some(multi) = multi { + arg = arg.multiple(multi); + } + scmd = scmd.arg(arg); + } + mcmd = mcmd.subcommand(scmd); + } + app = app.subcommand(mcmd); + } + + let matches = app.get_matches(); + + let debug = matches.is_present("debug"); + match Engine::new(matches) { + Err(err) => { + exit_status = err.exit_code; + writeln!(io::stderr(), "{}", err).ok(); + }, + Ok(engine) => { + if let Err(doit_err) = engine.doit() { + exit_status = 1; + match doit_err { + DoitError::IoError(path, err) => { + writeln!(io::stderr(), "Failed to open output file '{}': {}", path, err).ok(); + }, + DoitError::ApiError(err) => { + if debug { + writeln!(io::stderr(), "{:?}", err).ok(); + } else { + writeln!(io::stderr(), "{}", err).ok(); + } + } + } + } + } + } + + std::process::exit(exit_status); +} \ No newline at end of file diff --git a/gen/genomics1/Cargo.toml b/gen/genomics1/Cargo.toml new file mode 100644 index 0000000000..d25f7fbd73 --- /dev/null +++ b/gen/genomics1/Cargo.toml @@ -0,0 +1,27 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-genomics1" +version = "0.1.8+20150615" +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" +documentation = "http://byron.github.io/google-apis-rs/google_genomics1" +license = "MIT" +keywords = ["genomics", "google", "protocol", "web", "api"] +build = "src/build.rs" + + +[dependencies] +hyper = ">= 0.5.2" +mime = "0.0.11" +serde = ">= 0.4.1" +yup-oauth2 = "*" +url = "*" + +[build-dependencies] +syntex = { version = "*" } +serde_codegen = { version = "*" } + diff --git a/gen/genomics1/LICENSE.md b/gen/genomics1/LICENSE.md new file mode 100644 index 0000000000..ae22e6ec52 --- /dev/null +++ b/gen/genomics1/LICENSE.md @@ -0,0 +1,30 @@ + +The MIT License (MIT) +===================== + +Copyright © `2015` `Sebastian Thiel` + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the “Software”), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/gen/genomics1/README.md b/gen/genomics1/README.md new file mode 100644 index 0000000000..82d1219907 --- /dev/null +++ b/gen/genomics1/README.md @@ -0,0 +1,142 @@ + +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*. +# Features + +It seems there is nothing you can do here ... . + + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](http://byron.github.io/google-apis-rs/google_genomics1/struct.Genomics.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](http://byron.github.io/google-apis-rs/google_genomics1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](http://byron.github.io/google-apis-rs/google_genomics1/trait.CallBuilder.html) +* **[Resources](http://byron.github.io/google-apis-rs/google_genomics1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](http://byron.github.io/google-apis-rs/google_genomics1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](http://byron.github.io/google-apis-rs/google_genomics1/trait.CallBuilder.html)** + * operations to apply to *Resources* + +All *structures* are marked with applicable traits to further categorize them and ease browsing. + +Generally speaking, you can invoke *Activities* like this: + +```Rust,ignore +let r = hub.resource().activity(...).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 +specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired. +The `doit()` method performs the actual communication with the server and returns the respective result. + +# Usage + +## Setting up your Project + +To use this library, you would put the following lines into your `Cargo.toml` file: + +```toml +[dependencies] +google-genomics1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate yup_oauth2 as oauth2; +extern crate google_genomics1 as genomics1; + +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use genomics1::Genomics; + +// Get an ApplicationSecret instance by some means. It contains the `client_id` and +// `client_secret`, among other things. +let secret: ApplicationSecret = Default::default(); +// Instantiate the authenticator. It will choose a suitable authentication flow for you, +// unless you replace `None` with the desired Flow. +// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +// what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +// retrieve them from storage. +let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, + hyper::Client::new(), + ::default(), None); +let mut hub = Genomics::new(hyper::Client::new(), auth); + +``` + +## 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 +the doit() methods, or handed as possibly intermediate results to either the +[Hub Delegate](http://byron.github.io/google-apis-rs/google_genomics1/trait.Delegate.html), or the [Authenticator Delegate](http://byron.github.io/google-apis-rs/google_genomics1/../yup-oauth2/trait.AuthenticatorDelegate.html). + +When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This +makes the system potentially resilient to all kinds of errors. + +## Uploads and Downloads +If a method supports downloads, the response body, which is part of the [Result](http://byron.github.io/google-apis-rs/google_genomics1/enum.Result.html), should be +read by you to obtain the media. +If such a method also supports a [Response Result](http://byron.github.io/google-apis-rs/google_genomics1/trait.ResponseResult.html), it will return that by default. +You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making +this call: `.param("alt", "media")`. + +Methods supporting uploads can do so using up to 2 different protocols: +*simple* and *resumable*. The distinctiveness of each is represented by customized +`doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively. + +## Customization and Callbacks + +You may alter the way an `doit()` method is called by providing a [delegate](http://byron.github.io/google-apis-rs/google_genomics1/trait.Delegate.html) to the +[Method Builder](http://byron.github.io/google-apis-rs/google_genomics1/trait.CallBuilder.html) before making the final `doit()` call. +Respective methods will be called to provide progress information, as well as determine whether the system should +retry on failure. + +The [delegate trait](http://byron.github.io/google-apis-rs/google_genomics1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. + +## Optional Parts in Server-Requests + +All structures provided by this library are made to be [enocodable](http://byron.github.io/google-apis-rs/google_genomics1/trait.RequestValue.html) and +[decodable](http://byron.github.io/google-apis-rs/google_genomics1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +are valid. +Most optionals are are considered [Parts](http://byron.github.io/google-apis-rs/google_genomics1/trait.Part.html) which are identifiable by name, which will be sent to +the server to indicate either the set parts of the request or the desired parts in the response. + +## Builder Arguments + +Using [method builders](http://byron.github.io/google-apis-rs/google_genomics1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +These will always take a single argument, for which the following statements are true. + +* [PODs][wiki-pod] are handed by copy +* strings are passed as `&str` +* [request values](http://byron.github.io/google-apis-rs/google_genomics1/trait.RequestValue.html) are moved + +Arguments will always be copied or cloned into the builder, to make them independent of their original life times. + +[wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure +[builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern +[google-go-api]: https://github.com/google/google-api-go-client + +# License +The **genomics1** library was generated by Sebastian Thiel, and is placed +under the *MIT* license. +You can read the full text at the repository's [license file][repo-license]. + +[repo-license]: https://github.com/Byron/google-apis-rs/LICENSE.md diff --git a/gen/genomics1/src/build.rs b/gen/genomics1/src/build.rs new file mode 100644 index 0000000000..6b0f6b58f6 --- /dev/null +++ b/gen/genomics1/src/build.rs @@ -0,0 +1,16 @@ +extern crate syntex; +extern crate serde_codegen; + +use std::env; +use std::path::Path; + +pub fn main() { + let out_dir = env::var_os("OUT_DIR").unwrap(); + + let src = Path::new("src/lib.rs.in"); + let dst = Path::new(&out_dir).join("lib.rs"); + + let mut registry = syntex::Registry::new(); + serde_codegen::register(&mut registry); + registry.expand("google-genomics1", &src, &dst).unwrap(); +} diff --git a/gen/genomics1/src/cmn.rs b/gen/genomics1/src/cmn.rs new file mode 100644 index 0000000000..6294f5a77b --- /dev/null +++ b/gen/genomics1/src/cmn.rs @@ -0,0 +1,762 @@ +// COPY OF 'src/rust/api/cmn.rs' +// DO NOT EDIT +use std::io::{self, Read, Seek, Cursor, Write, SeekFrom}; +use std; +use std::fmt::{self, Display}; +use std::str::FromStr; +use std::error; +use std::thread::sleep_ms; + +use mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use oauth2::{TokenType, Retry, self}; +use hyper; +use hyper::header::{ContentType, ContentLength, Headers, UserAgent, Authorization, Header, + HeaderFormat}; +use hyper::http::LINE_ENDING; +use hyper::method::Method; +use hyper::status::StatusCode; + +use serde; + +/// Identifies the Hub. There is only one per library, this trait is supposed +/// to make intended use more explicit. +/// The hub allows to access all resource methods more easily. +pub trait Hub {} + +/// Identifies types for building methods of a particular resource type +pub trait MethodsBuilder {} + +/// Identifies types which represent builders for a particular resource method +pub trait CallBuilder {} + +/// Identifies types which can be inserted and deleted. +/// Types with this trait are most commonly used by clients of this API. +pub trait Resource {} + +/// Identifies types which are used in API responses. +pub trait ResponseResult {} + +/// Identifies types which are used in API requests. +pub trait RequestValue {} + +/// Identifies types which are not actually used by the API +/// This might be a bug within the google API schema. +pub trait UnusedType {} + +/// Identifies types which are only used as part of other types, which +/// usually are carrying the `Resource` trait. +pub trait Part {} + +/// Identifies types which are only used by other types internally. +/// They have no special meaning, this trait just marks them for completeness. +pub trait NestedType {} + +/// A utility to specify reader types which provide seeking capabilities too +pub trait ReadSeek: Seek + Read {} +impl ReadSeek for T {} + +/// A trait for all types that can convert themselves into a *parts* string +pub trait ToParts { + fn to_parts(&self) -> String; +} + +/// A utility type which can decode a server response that indicates error +#[derive(Deserialize)] +pub struct JsonServerError { + pub error: String, + pub error_description: Option +} + +/// A utility to represent detailed errors we might see in case there are BadRequests. +/// The latter happen if the sent parameters or request structures are unsound +#[derive(Deserialize, Serialize, Debug)] +pub struct ErrorResponse { + error: ServerError, +} + +#[derive(Deserialize, Serialize, Debug)] +pub struct ServerError { + errors: Vec, + code: u16, + message: String, +} + +#[derive(Deserialize, Serialize, Debug)] +pub struct ServerMessage { + domain: String, + reason: String, + message: String, + #[serde(rename="locationType")] + location_type: Option, + location: Option +} + +#[derive(Copy, Clone)] +pub struct DummyNetworkStream; + +impl Read for DummyNetworkStream { + fn read(&mut self, _: &mut [u8]) -> io::Result { + Ok(0) + } +} + +impl Write for DummyNetworkStream { + fn write(&mut self, _: &[u8]) -> io::Result { + Ok(0) + } + + fn flush(&mut self) -> io::Result<()> { + Ok(()) + } +} + +impl hyper::net::NetworkStream for DummyNetworkStream { + fn peer_addr(&mut self) -> io::Result { + Ok("127.0.0.1:1337".parse().unwrap()) + } +} + + +/// A trait specifying functionality to help controlling any request performed by the API. +/// The trait has a conservative default implementation. +/// +/// It contains methods to deal with all common issues, as well with the ones related to +/// uploading media +pub trait Delegate { + + /// Called at the beginning of any API request. The delegate should store the method + /// information if he is interesting in knowing more context when further calls to it + /// are made. + /// The matching `finished()` call will always be made, no matter whether or not the API + /// request was successful. That way, the delegate may easily maintain a clean state + /// between various API calls. + fn begin(&mut self, MethodInfo) {} + + /// Called whenever there is an [HttpError](http://hyperium.github.io/hyper/hyper/error/enum.HttpError.html), usually if there are network problems. + /// + /// If you choose to retry after a duration, the duration should be chosen using the + /// [exponential backoff algorithm](http://en.wikipedia.org/wiki/Exponential_backoff). + /// + /// Return retry information. + fn http_error(&mut self, &hyper::Error) -> Retry { + Retry::Abort + } + + /// Called whenever there is the need for your applications API key after + /// the official authenticator implementation didn't provide one, for some reason. + /// If this method returns None as well, the underlying operation will fail + fn api_key(&mut self) -> Option { + None + } + + /// Called whenever the Authenticator didn't yield a token. The delegate + /// may attempt to provide one, or just take it as a general information about the + /// impending failure. + /// The given Error provides information about why the token couldn't be acquired in the + /// first place + fn token(&mut self, err: &error::Error) -> Option { + let _ = err; + None + } + + /// Called during resumable uploads to provide a URL for the impending upload. + /// It was saved after a previous call to `store_upload_url(...)`, and if not None, + /// will be used instead of asking the server for a new upload URL. + /// This is useful in case a previous resumable upload was aborted/canceled, but should now + /// be resumed. + /// The returned URL will be used exactly once - if it fails again and the delegate allows + /// to retry, we will ask the server for a new upload URL. + fn upload_url(&mut self) -> Option { + None + } + + /// Called after we have retrieved a new upload URL for a resumable upload to store it + /// in case we fail or cancel. That way, we can attempt to resume the upload later, + /// see `upload_url()`. + /// It will also be called with None after a successful upload, which allows the delegate + /// to forget the URL. That way, we will not attempt to resume an upload that has already + /// finished. + fn store_upload_url(&mut self, url: Option<&str>) { + let _ = url; + } + + /// Called whenever a server response could not be decoded from json. + /// It's for informational purposes only, the caller will return with an error + /// accordingly. + /// + /// # Arguments + /// + /// * `json_encoded_value` - The json-encoded value which failed to decode. + /// * `json_decode_error` - The decoder error + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + let _ = json_encoded_value; + let _ = json_decode_error; + } + + /// Called whenever the http request returns with a non-success status code. + /// This can involve authentication issues, or anything else that very much + /// depends on the used API method. + /// The delegate should check the status, header and decoded json error to decide + /// whether to retry or not. In the latter case, the underlying call will fail. + /// + /// If you choose to retry after a duration, the duration should be chosen using the + /// [exponential backoff algorithm](http://en.wikipedia.org/wiki/Exponential_backoff). + fn http_failure(&mut self, _: &hyper::client::Response, Option, _: Option) -> Retry { + Retry::Abort + } + + /// Called prior to sending the main request of the given method. It can be used to time + /// the call or to print progress information. + /// It's also useful as you can be sure that a request will definitely be made. + fn pre_request(&mut self) { } + + /// Return the size of each chunk of a resumable upload. + /// Must be a power of two, with 1<<18 being the smallest allowed chunk size. + /// Will be called once before starting any resumable upload. + fn chunk_size(&mut self) -> u64 { + 1 << 23 + } + + /// Called before the given chunk is uploaded to the server. + /// If true is returned, the upload will be interrupted. + /// However, it may be resumable if you stored the upload URL in a previous call + /// to `store_upload_url()` + fn cancel_chunk_upload(&mut self, chunk: &ContentRange) -> bool { + let _ = chunk; + false + } + + /// Called before the API request method returns, in every case. It can be used to clean up + /// internal state between calls to the API. + /// This call always has a matching call to `begin(...)`. + /// + /// # Arguments + /// + /// * `is_success` - a true value indicates the operation was successful. If false, you should + /// discard all values stored during `store_upload_url`. + fn finished(&mut self, is_success: bool) { + let _ = is_success; + } +} + +/// A delegate with a conservative default implementation, which is used if no other delegate is +/// set. +#[derive(Default)] +pub struct DefaultDelegate; + +impl Delegate for DefaultDelegate {} + + +#[derive(Debug)] +pub enum Error { + /// The http connection failed + HttpError(hyper::Error), + + /// An attempt was made to upload a resource with size stored in field `.0` + /// even though the maximum upload size is what is stored in field `.1`. + UploadSizeLimitExceeded(u64, u64), + + /// Represents information about a request that was not understood by the server. + /// Details are included. + BadRequest(ErrorResponse), + + /// We needed an API key for authentication, but didn't obtain one. + /// Neither through the authenticator, nor through the Delegate. + MissingAPIKey, + + /// We required a Token, but didn't get one from the Authenticator + MissingToken(Box), + + /// The delgate instructed to cancel the operation + Cancelled, + + /// An additional, free form field clashed with one of the built-in optional ones + FieldClash(&'static str), + + /// Shows that we failed to decode the server response. + /// This can happen if the protocol changes in conjunction with strict json decoding. + JsonDecodeError(String, serde::json::Error), + + /// Indicates an HTTP repsonse with a non-success status code + Failure(hyper::client::Response), +} + + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + Error::HttpError(ref err) => err.fmt(f), + Error::UploadSizeLimitExceeded(ref resource_size, ref max_size) => + writeln!(f, "The media size {} exceeds the maximum allowed upload size of {}" + , resource_size, max_size), + Error::MissingAPIKey => { + (writeln!(f, "The application's API key was not found in the configuration")).ok(); + writeln!(f, "It is used as there are no Scopes defined for this method.") + }, + Error::BadRequest(ref err) => { + try!(writeln!(f, "Bad Requst ({}): {}", err.error.code, err.error.message)); + for err in err.error.errors.iter() { + try!(writeln!(f, " {}: {}, {}{}", + err.domain, + err.message, + err.reason, + match &err.location { + &Some(ref loc) => format!("@{}", loc), + &None => String::new(), + })); + } + Ok(()) + }, + Error::MissingToken(ref err) => + writeln!(f, "Token retrieval failed with error: {}", err), + Error::Cancelled => + writeln!(f, "Operation cancelled by delegate"), + Error::FieldClash(field) => + writeln!(f, "The custom parameter '{}' is already provided natively by the CallBuilder.", field), + Error::JsonDecodeError(ref json_str, ref err) + => writeln!(f, "{}: {}", err, json_str), + Error::Failure(ref response) => + writeln!(f, "Http status indicates failure: {:?}", response), + } + } +} + +impl error::Error for Error { + fn description(&self) -> &str { + match *self { + Error::HttpError(ref err) => err.description(), + Error::JsonDecodeError(_, ref err) => err.description(), + _ => "NO DESCRIPTION POSSIBLE - use `Display.fmt()` instead" + } + } + + fn cause(&self) -> Option<&error::Error> { + match *self { + Error::HttpError(ref err) => err.cause(), + Error::JsonDecodeError(_, ref err) => err.cause(), + _ => None + } + } +} + +/// A universal result type used as return for all calls. +pub type Result = std::result::Result; + +/// Contains information about an API request. +pub struct MethodInfo { + pub id: &'static str, + pub http_method: Method, +} + +const BOUNDARY: &'static str = "MDuXWGyeE33QFXGchb2VFWc4Z7945d"; + +/// Provides a `Read` interface that converts multiple parts into the protocol +/// identified by [RFC2387](https://tools.ietf.org/html/rfc2387). +/// **Note**: This implementation is just as rich as it needs to be to perform uploads +/// to google APIs, and might not be a fully-featured implementation. +#[derive(Default)] +pub struct MultiPartReader<'a> { + raw_parts: Vec<(Headers, &'a mut Read)>, + current_part: Option<(Cursor>, &'a mut Read)>, + last_part_boundary: Option>>, +} + +impl<'a> MultiPartReader<'a> { + + /// Reserve memory for exactly the given amount of parts + pub fn reserve_exact(&mut self, cap: usize) { + self.raw_parts.reserve_exact(cap); + } + + /// Add a new part to the queue of parts to be read on the first `read` call. + /// + /// # Arguments + /// + /// `headers` - identifying the body of the part. It's similar to the header + /// in an ordinary single-part call, and should thus contain the + /// same information. + /// `reader` - a reader providing the part's body + /// `size` - the amount of bytes provided by the reader. It will be put onto the header as + /// content-size. + /// `mime` - It will be put onto the content type + pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { + let mut headers = Headers::new(); + headers.set(ContentType(mime_type)); + headers.set(ContentLength(size)); + self.raw_parts.push((headers, reader)); + self + } + + /// Returns the mime-type representing our multi-part message. + /// Use it with the ContentType header. + pub fn mime_type(&self) -> Mime { + Mime( + TopLevel::Multipart, + SubLevel::Ext("Related".to_string()), + vec![(Attr::Ext("boundary".to_string()), Value::Ext(BOUNDARY.to_string()))], + ) + } + + /// Returns true if we are totally used + fn is_depleted(&self) -> bool { + self.raw_parts.len() == 0 && self.current_part.is_none() && self.last_part_boundary.is_none() + } + + /// Returns true if we are handling our last part + fn is_last_part(&self) -> bool { + self.raw_parts.len() == 0 && self.current_part.is_some() + } +} + +impl<'a> Read for MultiPartReader<'a> { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + match (self.raw_parts.len(), + self.current_part.is_none(), + self.last_part_boundary.is_none()) { + (_, _, false) => { + let br = self.last_part_boundary.as_mut().unwrap().read(buf).unwrap_or(0); + if br < buf.len() { + self.last_part_boundary = None; + } + return Ok(br) + }, + (0, true, true) => return Ok(0), + (n, true, _) if n > 0 => { + let (headers, reader) = self.raw_parts.remove(0); + let mut c = Cursor::new(Vec::::new()); + (write!(&mut c, "{}--{}{}{}{}", LINE_ENDING, BOUNDARY, LINE_ENDING, + headers, LINE_ENDING)).unwrap(); + c.seek(SeekFrom::Start(0)).unwrap(); + self.current_part = Some((c, reader)); + } + _ => {}, + } + + // read headers as long as possible + let (hb, rr) = { + let &mut (ref mut c, ref mut reader) = self.current_part.as_mut().unwrap(); + let b = c.read(buf).unwrap_or(0); + (b, reader.read(&mut buf[b..])) + }; + + match rr { + Ok(bytes_read) => { + if hb < buf.len() && bytes_read == 0 { + if self.is_last_part() { + // before clearing the last part, we will add the boundary that + // will be written last + self.last_part_boundary = Some(Cursor::new( + format!("{}--{}--", LINE_ENDING, BOUNDARY).into_bytes())) + } + // We are depleted - this can trigger the next part to come in + self.current_part = None; + } + let mut total_bytes_read = hb + bytes_read; + while total_bytes_read < buf.len() && !self.is_depleted() { + match self.read(&mut buf[total_bytes_read ..]) { + Ok(br) => total_bytes_read += br, + Err(err) => return Err(err), + } + } + Ok(total_bytes_read) + } + Err(err) => { + // fail permanently + self.current_part = None; + self.last_part_boundary = None; + self.raw_parts.clear(); + Err(err) + } + } + } +} + +// The following macro invocation needs to be expanded, as `include!` +// doens't support external macros +// header!{ +// #[doc="The `X-Upload-Content-Type` header."] +// (XUploadContentType, "X-Upload-Content-Type") => [Mime] + +// xupload_content_type { +// test_header!( +// test1, +// vec![b"text/plain"], +// Some(HeaderField( +// vec![Mime(TopLevel::Text, SubLevel::Plain, Vec::new())] +// ))); + +// } +// } + +/// The `X-Upload-Content-Type` header. +/// +/// Generated via rustc --pretty expanded -Z unstable-options, and manually +/// processed to be more readable. +#[derive(PartialEq, Debug, Clone)] +pub struct XUploadContentType(pub Mime); + +impl ::std::ops::Deref for XUploadContentType { + type Target = Mime; + fn deref<'a>(&'a self) -> &'a Mime { &self.0 } +} +impl ::std::ops::DerefMut for XUploadContentType { + fn deref_mut<'a>(&'a mut self) -> &'a mut Mime { &mut self.0 } +} +impl Header for XUploadContentType { + fn header_name() -> &'static str { "X-Upload-Content-Type" } + fn parse_header(raw: &[Vec]) -> Option { + hyper::header::parsing::from_one_raw_str(raw).map(XUploadContentType) + } +} +impl HeaderFormat for XUploadContentType { + fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result { + Display::fmt(&**self, f) + } +} +impl Display for XUploadContentType { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&**self, f) + } +} + +#[derive(Clone, PartialEq, Debug)] +pub struct Chunk { + pub first: u64, + pub last: u64 +} + +impl fmt::Display for Chunk { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + (write!(fmt, "{}-{}", self.first, self.last)).ok(); + Ok(()) + } +} + +impl FromStr for Chunk { + type Err = &'static str; + + /// NOTE: only implements `%i-%i`, not `*` + fn from_str(s: &str) -> std::result::Result { + let parts: Vec<&str> = s.split('-').collect(); + if parts.len() != 2 { + return Err("Expected two parts: %i-%i") + } + Ok( + Chunk { + first: match FromStr::from_str(parts[0]) { + Ok(d) => d, + _ => return Err("Couldn't parse 'first' as digit") + }, + last: match FromStr::from_str(parts[1]) { + Ok(d) => d, + _ => return Err("Couldn't parse 'last' as digit") + } + } + ) + } +} + +/// Implements the Content-Range header, for serialization only +#[derive(Clone, PartialEq, Debug)] +pub struct ContentRange { + pub range: Option, + pub total_length: u64, +} + +impl Header for ContentRange { + fn header_name() -> &'static str { + "Content-Range" + } + + /// We are not parsable, as parsing is done by the `Range` header + fn parse_header(_: &[Vec]) -> Option { + None + } +} + + +impl HeaderFormat for ContentRange { + fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + try!(fmt.write_str("bytes ")); + match self.range { + Some(ref c) => try!(c.fmt(fmt)), + None => try!(fmt.write_str("*")) + } + (write!(fmt, "/{}", self.total_length)).ok(); + Ok(()) + } +} + +#[derive(Clone, PartialEq, Debug)] +pub struct RangeResponseHeader(pub Chunk); + +impl Header for RangeResponseHeader { + fn header_name() -> &'static str { + "Range" + } + + fn parse_header(raw: &[Vec]) -> Option { + 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)) + } + } + } + } + None + } +} + +impl HeaderFormat for RangeResponseHeader { + /// No implmentation necessary, we just need to parse + fn fmt_header(&self, _: &mut fmt::Formatter) -> fmt::Result { + Err(fmt::Error) + } +} + +/// A utility type to perform a resumable upload from start to end. +pub struct ResumableUploadHelper<'a, A: 'a> { + pub client: &'a mut hyper::client::Client, + pub delegate: &'a mut Delegate, + pub start_at: Option, + pub auth: &'a mut A, + pub user_agent: &'a str, + pub auth_header: Authorization, + pub url: &'a str, + pub reader: &'a mut ReadSeek, + pub media_type: Mime, + pub content_length: u64 +} + +impl<'a, A> ResumableUploadHelper<'a, A> + where A: oauth2::GetToken { + + fn query_transfer_status(&mut self) -> std::result::Result> { + loop { + match self.client.post(self.url) + .header(UserAgent(self.user_agent.to_string())) + .header(ContentRange { range: None, total_length: self.content_length }) + .header(self.auth_header.clone()) + .send() { + Ok(r) => { + // 308 = resume-incomplete == PermanentRedirect + let headers = r.headers.clone(); + let h: &RangeResponseHeader = match headers.get() { + Some(hh) if r.status == StatusCode::PermanentRedirect => hh, + None|Some(_) => { + if let Retry::After(d) = self.delegate.http_failure(&r, None, None) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + return Err(Ok(r)) + } + }; + return Ok(h.0.last) + } + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + return Err(Err(err)) + } + } + } + } + + /// returns None if operation was cancelled by delegate, or the HttpResult. + /// It can be that we return the result just because we didn't understand the status code - + /// caller should check for status himself before assuming it's OK to use + pub fn upload(&mut self) -> Option> { + let mut start = match self.start_at { + Some(s) => s, + None => match self.query_transfer_status() { + Ok(s) => s, + Err(result) => return Some(result) + } + }; + + const MIN_CHUNK_SIZE: u64 = 1 << 18; + let chunk_size = match self.delegate.chunk_size() { + cs if cs > MIN_CHUNK_SIZE => cs, + _ => MIN_CHUNK_SIZE + }; + + self.reader.seek(SeekFrom::Start(start)).unwrap(); + loop { + let request_size = match self.content_length - start { + rs if rs > chunk_size => chunk_size, + rs => rs + }; + + let mut section_reader = self.reader.take(request_size); + let range_header = ContentRange { + range: Some(Chunk {first: start, last: start + request_size - 1}), + total_length: self.content_length + }; + start += request_size; + if self.delegate.cancel_chunk_upload(&range_header) { + return None + } + // workaround https://github.com/rust-lang/rust/issues/22252 + let res = self.client.post(self.url) + .header(range_header) + .header(ContentType(self.media_type.clone())) + .header(UserAgent(self.user_agent.to_string())) + .body(&mut section_reader) + .send(); + match res { + Ok(mut res) => { + if res.status == StatusCode::PermanentRedirect { + continue + } + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let Retry::After(d) = self.delegate.http_failure(&res, + serde::json::from_str(&json_err).ok(), + serde::json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + } + return Some(Ok(res)) + }, + Err(err) => { + if let Retry::After(d) = self.delegate.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + return Some(Err(err)) + } + } + } + } +} + +// Copy of src/rust/cli/cmn.rs +// TODO(ST): Allow sharing common code between program types +pub fn remove_json_null_values(value: &mut serde::json::value::Value) { + match *value { + serde::json::value::Value::Object(ref mut map) => { + let mut for_removal = Vec::new(); + + for (key, mut value) in map.iter_mut() { + if value.is_null() { + for_removal.push(key.clone()); + } else { + remove_json_null_values(&mut value); + } + } + + for key in &for_removal { + map.remove(key); + } + } + _ => {} + } +} diff --git a/gen/genomics1/src/lib.rs b/gen/genomics1/src/lib.rs new file mode 100644 index 0000000000..ee156f4f3f --- /dev/null +++ b/gen/genomics1/src/lib.rs @@ -0,0 +1,146 @@ +// DO NOT EDIT ! +// 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*. +//! 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 ... . +//! +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](../index.html). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.Genomics.html)** +//! * a central object to maintain state and allow accessing all *Activities* +//! * creates [*Method Builders*](trait.MethodsBuilder.html) which in turn +//! allow access to individual [*Call Builders*](trait.CallBuilder.html) +//! * **[Resources](trait.Resource.html)** +//! * primary types that you can apply *Activities* to +//! * a collection of properties and *Parts* +//! * **[Parts](trait.Part.html)** +//! * a collection of properties +//! * never directly used in *Activities* +//! * **[Activities](trait.CallBuilder.html)** +//! * operations to apply to *Resources* +//! +//! All *structures* are marked with applicable traits to further categorize them and ease browsing. +//! +//! Generally speaking, you can invoke *Activities* like this: +//! +//! ```Rust,ignore +//! let r = hub.resource().activity(...).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 +//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired. +//! The `doit()` method performs the actual communication with the server and returns the respective result. +//! +//! # Usage +//! +//! ## Setting up your Project +//! +//! To use this library, you would put the following lines into your `Cargo.toml` file: +//! +//! ```toml +//! [dependencies] +//! google-genomics1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```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; +//! +//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and +//! // `client_secret`, among other things. +//! let secret: ApplicationSecret = Default::default(); +//! // Instantiate the authenticator. It will choose a suitable authentication flow for you, +//! // unless you replace `None` with the desired Flow. +//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +//! // retrieve them from storage. +//! let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +//! hyper::Client::new(), +//! ::default(), None); +//! let mut hub = Genomics::new(hyper::Client::new(), auth); +//! # } +//! ``` +//! +//! ## Handling Errors +//! +//! All errors produced by the system are provided either as [Result](enum.Result.html) enumeration as return value of +//! the doit() methods, or handed as possibly intermediate results to either the +//! [Hub Delegate](trait.Delegate.html), or the [Authenticator Delegate](../yup-oauth2/trait.AuthenticatorDelegate.html). +//! +//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This +//! makes the system potentially resilient to all kinds of errors. +//! +//! ## Uploads and Downloads +//! If a method supports downloads, the response body, which is part of the [Result](enum.Result.html), should be +//! read by you to obtain the media. +//! If such a method also supports a [Response Result](trait.ResponseResult.html), it will return that by default. +//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making +//! this call: `.param("alt", "media")`. +//! +//! Methods supporting uploads can do so using up to 2 different protocols: +//! *simple* and *resumable*. The distinctiveness of each is represented by customized +//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively. +//! +//! ## Customization and Callbacks +//! +//! You may alter the way an `doit()` method is called by providing a [delegate](trait.Delegate.html) to the +//! [Method Builder](trait.CallBuilder.html) before making the final `doit()` call. +//! Respective methods will be called to provide progress information, as well as determine whether the system should +//! retry on failure. +//! +//! The [delegate trait](trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +//! +//! ## Optional Parts in Server-Requests +//! +//! All structures provided by this library are made to be [enocodable](trait.RequestValue.html) and +//! [decodable](trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +//! are valid. +//! Most optionals are are considered [Parts](trait.Part.html) which are identifiable by name, which will be sent to +//! the server to indicate either the set parts of the request or the desired parts in the response. +//! +//! ## Builder Arguments +//! +//! Using [method builders](trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +//! These will always take a single argument, for which the following statements are true. +//! +//! * [PODs][wiki-pod] are handed by copy +//! * strings are passed as `&str` +//! * [request values](trait.RequestValue.html) are moved +//! +//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times. +//! +//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure +//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern +//! [google-go-api]: https://github.com/google/google-api-go-client +//! +//! + +// Unused attributes happen thanks to defined, but unused structures +// We don't warn about this, as depending on the API, some data structures or facilities are never used. +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// unused imports in fully featured APIs. Same with unused_mut ... . +#![allow(unused_imports, unused_mut, dead_code)] + +include!(concat!(env!("OUT_DIR"), "/lib.rs")); \ No newline at end of file diff --git a/gen/genomics1/src/lib.rs.in b/gen/genomics1/src/lib.rs.in new file mode 100644 index 0000000000..db7e0aad64 --- /dev/null +++ b/gen/genomics1/src/lib.rs.in @@ -0,0 +1,112 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.in.mako' +// DO NOT EDIT ! + +extern crate hyper; +extern crate serde; +extern crate yup_oauth2 as oauth2; +extern crate mime; +extern crate url; + +mod cmn; + +use std::collections::HashMap; +use std::cell::RefCell; +use std::borrow::BorrowMut; +use std::default::Default; +use std::collections::BTreeMap; +use serde::json; +use std::io; +use std::fs; +use std::thread::sleep_ms; + +pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, Hub, ReadSeek, Part, + ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder, + Resource, ErrorResponse, remove_json_null_values}; + + +// ############## +// UTILITIES ### +// ############ + + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all Genomics related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```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; +/// +/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and +/// // `client_secret`, among other things. +/// let secret: ApplicationSecret = Default::default(); +/// // Instantiate the authenticator. It will choose a suitable authentication flow for you, +/// // unless you replace `None` with the desired Flow. +/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +/// // retrieve them from storage. +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Genomics::new(hyper::Client::new(), auth); +/// # } +/// ``` +/// +pub struct Genomics { + client: RefCell, + auth: RefCell, + _user_agent: String, +} + +impl<'a, C, A> Hub for Genomics {} + +impl<'a, C, A> Genomics + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> Genomics { + Genomics { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/0.1.8".to_string(), + } + } + + + /// Set the user-agent header field to use in all requests to the server. + /// It defaults to `google-api-rust-client/0.1.8`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + let prev = self._user_agent.clone(); + self._user_agent = agent_name; + prev + } +} + + + +// ################### +// MethodBuilders ### +// ################# + + + +// ################### +// CallBuilders ### +// ################# + diff --git a/gen/gmail1-cli/Cargo.toml b/gen/gmail1-cli/Cargo.toml index 16625937bd..a847bbb02d 100644 --- a/gen/gmail1-cli/Cargo.toml +++ b/gen/gmail1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gmail1-cli" -version = "0.3.0+20150303" +version = "0.3.0+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with gmail (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gmail1-cli" @@ -17,8 +17,8 @@ keywords = ["gmail", "google", "cli"] name = "gmail1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/gmail1-cli/README.md b/gen/gmail1-cli/README.md index 7631a21cea..fca72df23b 100644 --- a/gen/gmail1-cli/README.md +++ b/gen/gmail1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *gmail* API at revision *20150303*. The CLI is at version *0.3.0*. +This documentation was generated from the *gmail* API at revision *20150526*. The CLI is at version *0.3.0*. ```bash gmail1 [options] @@ -53,12 +53,14 @@ gmail1 [options] messages-send (-r )... (-u (simple|resumable) -f [-m ]) [-p ]... [-o ] messages-trash [-p ]... [-o ] messages-untrash [-p ]... [-o ] + stop [-p ]... threads-delete [-p ]... threads-get [-p ]... [-o ] threads-list [-p ]... [-o ] threads-modify (-r )... [-p ]... [-o ] threads-trash [-p ]... [-o ] threads-untrash [-p ]... [-o ] + watch (-r )... [-p ]... [-o ] gmail1 --help Configuration: diff --git a/gen/gmail1-cli/mkdocs.yml b/gen/gmail1-cli/mkdocs.yml index b8ed15bf49..6a7f3faadc 100644 --- a/gen/gmail1-cli/mkdocs.yml +++ b/gen/gmail1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: gmail v0.3.0+20150303 +site_name: gmail v0.3.0+20150526 site_url: http://byron.github.io/google-apis-rs/google-gmail1-cli site_description: Write integrating applications with bcore @@ -33,12 +33,14 @@ pages: - ['users_messages-send.md', 'Users', 'Messages Send'] - ['users_messages-trash.md', 'Users', 'Messages Trash'] - ['users_messages-untrash.md', 'Users', 'Messages Untrash'] +- ['users_stop.md', 'Users', 'Stop'] - ['users_threads-delete.md', 'Users', 'Threads Delete'] - ['users_threads-get.md', 'Users', 'Threads Get'] - ['users_threads-list.md', 'Users', 'Threads List'] - ['users_threads-modify.md', 'Users', 'Threads Modify'] - ['users_threads-trash.md', 'Users', 'Threads Trash'] - ['users_threads-untrash.md', 'Users', 'Threads Untrash'] +- ['users_watch.md', 'Users', 'Watch'] theme: readthedocs diff --git a/gen/gmail1-cli/src/main.rs b/gen/gmail1-cli/src/main.rs index fac39e7df3..0204a7813c 100644 --- a/gen/gmail1-cli/src/main.rs +++ b/gen/gmail1-cli/src/main.rs @@ -67,6 +67,7 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "message.internal-date" => Some(("message.internalDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.history-id" => Some(("message.historyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.payload.body.data" => Some(("message.payload.body.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.payload.body.attachment-id" => Some(("message.payload.body.attachmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -82,7 +83,7 @@ impl<'n, 'a> Engine<'n, 'a> { "message.id" => Some(("message.id", 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!["attachment-id", "body", "data", "filename", "history-id", "id", "label-ids", "message", "mime-type", "part-id", "payload", "raw", "size", "size-estimate", "snippet", "thread-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["attachment-id", "body", "data", "filename", "history-id", "id", "internal-date", "label-ids", "message", "mime-type", "part-id", "payload", "raw", "size", "size-estimate", "snippet", "thread-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -139,6 +140,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -238,6 +240,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -296,6 +299,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -325,6 +329,7 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "message.internal-date" => Some(("message.internalDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.history-id" => Some(("message.historyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.payload.body.data" => Some(("message.payload.body.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.payload.body.attachment-id" => Some(("message.payload.body.attachmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -340,7 +345,7 @@ impl<'n, 'a> Engine<'n, 'a> { "message.id" => Some(("message.id", 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!["attachment-id", "body", "data", "filename", "history-id", "id", "label-ids", "message", "mime-type", "part-id", "payload", "raw", "size", "size-estimate", "snippet", "thread-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["attachment-id", "body", "data", "filename", "history-id", "id", "internal-date", "label-ids", "message", "mime-type", "part-id", "payload", "raw", "size", "size-estimate", "snippet", "thread-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -397,6 +402,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -426,6 +432,7 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "message.internal-date" => Some(("message.internalDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.history-id" => Some(("message.historyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.payload.body.data" => Some(("message.payload.body.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.payload.body.attachment-id" => Some(("message.payload.body.attachmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -441,7 +448,7 @@ impl<'n, 'a> Engine<'n, 'a> { "message.id" => Some(("message.id", 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!["attachment-id", "body", "data", "filename", "history-id", "id", "label-ids", "message", "mime-type", "part-id", "payload", "raw", "size", "size-estimate", "snippet", "thread-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["attachment-id", "body", "data", "filename", "history-id", "id", "internal-date", "label-ids", "message", "mime-type", "part-id", "payload", "raw", "size", "size-estimate", "snippet", "thread-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -498,6 +505,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -549,6 +557,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -613,6 +622,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -705,6 +715,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -800,6 +811,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -851,6 +863,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -943,6 +956,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1035,6 +1049,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1086,6 +1101,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1188,6 +1204,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1217,6 +1234,7 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "internal-date" => Some(("internalDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "history-id" => Some(("historyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "payload.body.data" => Some(("payload.body.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "payload.body.attachment-id" => Some(("payload.body.attachmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1231,7 +1249,7 @@ impl<'n, 'a> Engine<'n, 'a> { "label-ids" => Some(("labelIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["attachment-id", "body", "data", "filename", "history-id", "id", "label-ids", "mime-type", "part-id", "payload", "raw", "size", "size-estimate", "snippet", "thread-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["attachment-id", "body", "data", "filename", "history-id", "id", "internal-date", "label-ids", "mime-type", "part-id", "payload", "raw", "size", "size-estimate", "snippet", "thread-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1301,6 +1319,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1330,6 +1349,7 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "internal-date" => Some(("internalDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "history-id" => Some(("historyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "payload.body.data" => Some(("payload.body.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "payload.body.attachment-id" => Some(("payload.body.attachmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1344,7 +1364,7 @@ impl<'n, 'a> Engine<'n, 'a> { "label-ids" => Some(("labelIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["attachment-id", "body", "data", "filename", "history-id", "id", "label-ids", "mime-type", "part-id", "payload", "raw", "size", "size-estimate", "snippet", "thread-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["attachment-id", "body", "data", "filename", "history-id", "id", "internal-date", "label-ids", "mime-type", "part-id", "payload", "raw", "size", "size-estimate", "snippet", "thread-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1408,6 +1428,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1475,6 +1496,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1560,6 +1582,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1589,6 +1612,7 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "internal-date" => Some(("internalDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "history-id" => Some(("historyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "payload.body.data" => Some(("payload.body.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "payload.body.attachment-id" => Some(("payload.body.attachmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1603,7 +1627,7 @@ impl<'n, 'a> Engine<'n, 'a> { "label-ids" => Some(("labelIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["attachment-id", "body", "data", "filename", "history-id", "id", "label-ids", "mime-type", "part-id", "payload", "raw", "size", "size-estimate", "snippet", "thread-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["attachment-id", "body", "data", "filename", "history-id", "id", "internal-date", "label-ids", "mime-type", "part-id", "payload", "raw", "size", "size-estimate", "snippet", "thread-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1660,6 +1684,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1711,6 +1736,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1762,6 +1788,51 @@ impl<'n, 'a> Engine<'n, 'a> { 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 _users_stop(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().stop(opt.value_of("user-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); + } + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok(mut response) => { Ok(()) } } @@ -1864,6 +1935,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1931,6 +2003,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2016,6 +2089,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2067,6 +2141,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2118,6 +2193,94 @@ impl<'n, 'a> Engine<'n, 'a> { 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 _users_watch(&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()[..] { + "label-ids" => Some(("labelIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "topic-name" => Some(("topicName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "label-filter-action" => Some(("labelFilterAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["label-filter-action", "label-ids", "topic-name"]); + 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::WatchRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.users().watch(request, opt.value_of("user-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(()) } } @@ -2203,6 +2366,9 @@ impl<'n, 'a> Engine<'n, 'a> { ("messages-untrash", Some(opt)) => { call_result = self._users_messages_untrash(opt, dry_run, &mut err); }, + ("stop", Some(opt)) => { + call_result = self._users_stop(opt, dry_run, &mut err); + }, ("threads-delete", Some(opt)) => { call_result = self._users_threads_delete(opt, dry_run, &mut err); }, @@ -2221,6 +2387,9 @@ impl<'n, 'a> Engine<'n, 'a> { ("threads-untrash", Some(opt)) => { call_result = self._users_threads_untrash(opt, dry_run, &mut err); }, + ("watch", Some(opt)) => { + call_result = self._users_watch(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("users".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -2261,7 +2430,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() @@ -2274,7 +2443,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() @@ -2310,7 +2479,7 @@ fn main() { let mut exit_status = 0i32; let upload_value_names = ["mode", "file"]; let arg_data = [ - ("users", "methods: 'drafts-create', 'drafts-delete', 'drafts-get', 'drafts-list', 'drafts-send', 'drafts-update', 'get-profile', 'history-list', 'labels-create', 'labels-delete', 'labels-get', 'labels-list', 'labels-patch', 'labels-update', 'messages-attachments-get', 'messages-delete', 'messages-get', 'messages-import', 'messages-insert', 'messages-list', 'messages-modify', 'messages-send', 'messages-trash', 'messages-untrash', 'threads-delete', 'threads-get', 'threads-list', 'threads-modify', 'threads-trash' and 'threads-untrash'", vec![ + ("users", "methods: 'drafts-create', 'drafts-delete', 'drafts-get', 'drafts-list', 'drafts-send', 'drafts-update', 'get-profile', 'history-list', 'labels-create', 'labels-delete', 'labels-get', 'labels-list', 'labels-patch', 'labels-update', 'messages-attachments-get', 'messages-delete', 'messages-get', 'messages-import', 'messages-insert', 'messages-list', 'messages-modify', 'messages-send', 'messages-trash', 'messages-untrash', 'stop', 'threads-delete', 'threads-get', 'threads-list', 'threads-modify', 'threads-trash', 'threads-untrash' and 'watch'", vec![ ("drafts-create", Some(r##"Creates a new draft with the DRAFT label."##), "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_drafts-create", @@ -3001,6 +3170,22 @@ fn main() { Some(false), Some(false)), ]), + ("stop", + Some(r##"Stop receiving push notifications for the given user mailbox."##), + "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_stop", + vec![ + (Some(r##"user-id"##), + None, + Some(r##"The user's email address. The special value me can be used to indicate the authenticated user."##), + 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)), + ]), ("threads-delete", Some(r##"Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead."##), "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_threads-delete", @@ -3157,6 +3342,34 @@ fn main() { 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)), + ]), + ("watch", + Some(r##"Set up or update a push notification watch on the given user mailbox."##), + "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_watch", + vec![ + (Some(r##"user-id"##), + None, + Some(r##"The user's email address. The special value me can be used to indicate the authenticated user."##), + 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"##), @@ -3169,7 +3382,7 @@ fn main() { let mut app = App::new("gmail1") .author("Sebastian Thiel ") - .version("0.3.0+20150303") + .version("0.3.0+20150526") .about("The Gmail REST API.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_gmail1_cli") .arg(Arg::with_name("url") diff --git a/gen/gmail1/Cargo.toml b/gen/gmail1/Cargo.toml index 82b0a91391..21a6334efb 100644 --- a/gen/gmail1/Cargo.toml +++ b/gen/gmail1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gmail1" -version = "0.1.8+20150303" +version = "0.1.8+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with gmail (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gmail1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/gmail1/README.md b/gen/gmail1/README.md index 6412d7beca..c80b98d9bf 100644 --- a/gen/gmail1/README.md +++ b/gen/gmail1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-gmail1` library allows access to all features of the *Google gmail* service. -This documentation was generated from *gmail* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *gmail* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *gmail* *v1* API can be found at the [official documentation site](https://developers.google.com/gmail/api/). @@ -14,7 +14,7 @@ Everything else about the *gmail* *v1* API can be found at the Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_gmail1/struct.Gmail.html) ... * users - * [*drafts create*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftCreateCall.html), [*drafts delete*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftDeleteCall.html), [*drafts get*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftGetCall.html), [*drafts list*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftListCall.html), [*drafts send*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftSendCall.html), [*drafts update*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftUpdateCall.html), [*get profile*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserGetProfileCall.html), [*history list*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserHistoryListCall.html), [*labels create*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserLabelCreateCall.html), [*labels delete*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserLabelDeleteCall.html), [*labels get*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserLabelGetCall.html), [*labels list*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserLabelListCall.html), [*labels patch*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserLabelPatchCall.html), [*labels update*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserLabelUpdateCall.html), [*messages attachments get*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageAttachmentGetCall.html), [*messages delete*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageDeleteCall.html), [*messages get*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageGetCall.html), [*messages import*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageImportCall.html), [*messages insert*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageInsertCall.html), [*messages list*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageListCall.html), [*messages modify*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageModifyCall.html), [*messages send*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageSendCall.html), [*messages trash*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageTrashCall.html), [*messages untrash*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageUntrashCall.html), [*threads delete*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserThreadDeleteCall.html), [*threads get*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserThreadGetCall.html), [*threads list*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserThreadListCall.html), [*threads modify*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserThreadModifyCall.html), [*threads trash*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserThreadTrashCall.html) and [*threads untrash*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserThreadUntrashCall.html) + * [*drafts create*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftCreateCall.html), [*drafts delete*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftDeleteCall.html), [*drafts get*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftGetCall.html), [*drafts list*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftListCall.html), [*drafts send*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftSendCall.html), [*drafts update*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftUpdateCall.html), [*get profile*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserGetProfileCall.html), [*history list*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserHistoryListCall.html), [*labels create*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserLabelCreateCall.html), [*labels delete*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserLabelDeleteCall.html), [*labels get*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserLabelGetCall.html), [*labels list*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserLabelListCall.html), [*labels patch*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserLabelPatchCall.html), [*labels update*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserLabelUpdateCall.html), [*messages attachments get*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageAttachmentGetCall.html), [*messages delete*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageDeleteCall.html), [*messages get*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageGetCall.html), [*messages import*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageImportCall.html), [*messages insert*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageInsertCall.html), [*messages list*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageListCall.html), [*messages modify*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageModifyCall.html), [*messages send*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageSendCall.html), [*messages trash*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageTrashCall.html), [*messages untrash*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageUntrashCall.html), [*stop*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserStopCall.html), [*threads delete*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserThreadDeleteCall.html), [*threads get*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserThreadGetCall.html), [*threads list*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserThreadListCall.html), [*threads modify*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserThreadModifyCall.html), [*threads trash*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserThreadTrashCall.html), [*threads untrash*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserThreadUntrashCall.html) and [*watch*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserWatchCall.html) Upload supported by ... @@ -22,8 +22,8 @@ Upload supported by ... * [*messages import users*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageImportCall.html) * [*drafts create users*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftCreateCall.html) * [*drafts send users*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftSendCall.html) -* [*messages send users*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageSendCall.html) * [*drafts update users*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserDraftUpdateCall.html) +* [*messages send users*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageSendCall.html) * [*messages insert users*](http://byron.github.io/google-apis-rs/google_gmail1/struct.UserMessageInsertCall.html) diff --git a/gen/gmail1/src/cmn.rs b/gen/gmail1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/gmail1/src/cmn.rs +++ b/gen/gmail1/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/gmail1/src/lib.rs b/gen/gmail1/src/lib.rs index 0b5da06d08..48861a00b2 100644 --- a/gen/gmail1/src/lib.rs +++ b/gen/gmail1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *gmail* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *gmail* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *gmail* *v1* API can be found at the //! [official documentation site](https://developers.google.com/gmail/api/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Gmail.html) ... //! //! * users -//! * [*drafts create*](struct.UserDraftCreateCall.html), [*drafts delete*](struct.UserDraftDeleteCall.html), [*drafts get*](struct.UserDraftGetCall.html), [*drafts list*](struct.UserDraftListCall.html), [*drafts send*](struct.UserDraftSendCall.html), [*drafts update*](struct.UserDraftUpdateCall.html), [*get profile*](struct.UserGetProfileCall.html), [*history list*](struct.UserHistoryListCall.html), [*labels create*](struct.UserLabelCreateCall.html), [*labels delete*](struct.UserLabelDeleteCall.html), [*labels get*](struct.UserLabelGetCall.html), [*labels list*](struct.UserLabelListCall.html), [*labels patch*](struct.UserLabelPatchCall.html), [*labels update*](struct.UserLabelUpdateCall.html), [*messages attachments get*](struct.UserMessageAttachmentGetCall.html), [*messages delete*](struct.UserMessageDeleteCall.html), [*messages get*](struct.UserMessageGetCall.html), [*messages import*](struct.UserMessageImportCall.html), [*messages insert*](struct.UserMessageInsertCall.html), [*messages list*](struct.UserMessageListCall.html), [*messages modify*](struct.UserMessageModifyCall.html), [*messages send*](struct.UserMessageSendCall.html), [*messages trash*](struct.UserMessageTrashCall.html), [*messages untrash*](struct.UserMessageUntrashCall.html), [*threads delete*](struct.UserThreadDeleteCall.html), [*threads get*](struct.UserThreadGetCall.html), [*threads list*](struct.UserThreadListCall.html), [*threads modify*](struct.UserThreadModifyCall.html), [*threads trash*](struct.UserThreadTrashCall.html) and [*threads untrash*](struct.UserThreadUntrashCall.html) +//! * [*drafts create*](struct.UserDraftCreateCall.html), [*drafts delete*](struct.UserDraftDeleteCall.html), [*drafts get*](struct.UserDraftGetCall.html), [*drafts list*](struct.UserDraftListCall.html), [*drafts send*](struct.UserDraftSendCall.html), [*drafts update*](struct.UserDraftUpdateCall.html), [*get profile*](struct.UserGetProfileCall.html), [*history list*](struct.UserHistoryListCall.html), [*labels create*](struct.UserLabelCreateCall.html), [*labels delete*](struct.UserLabelDeleteCall.html), [*labels get*](struct.UserLabelGetCall.html), [*labels list*](struct.UserLabelListCall.html), [*labels patch*](struct.UserLabelPatchCall.html), [*labels update*](struct.UserLabelUpdateCall.html), [*messages attachments get*](struct.UserMessageAttachmentGetCall.html), [*messages delete*](struct.UserMessageDeleteCall.html), [*messages get*](struct.UserMessageGetCall.html), [*messages import*](struct.UserMessageImportCall.html), [*messages insert*](struct.UserMessageInsertCall.html), [*messages list*](struct.UserMessageListCall.html), [*messages modify*](struct.UserMessageModifyCall.html), [*messages send*](struct.UserMessageSendCall.html), [*messages trash*](struct.UserMessageTrashCall.html), [*messages untrash*](struct.UserMessageUntrashCall.html), [*stop*](struct.UserStopCall.html), [*threads delete*](struct.UserThreadDeleteCall.html), [*threads get*](struct.UserThreadGetCall.html), [*threads list*](struct.UserThreadListCall.html), [*threads modify*](struct.UserThreadModifyCall.html), [*threads trash*](struct.UserThreadTrashCall.html), [*threads untrash*](struct.UserThreadUntrashCall.html) and [*watch*](struct.UserWatchCall.html) //! //! //! Upload supported by ... @@ -20,8 +20,8 @@ //! * [*messages import users*](struct.UserMessageImportCall.html) //! * [*drafts create users*](struct.UserDraftCreateCall.html) //! * [*drafts send users*](struct.UserDraftSendCall.html) -//! * [*messages send users*](struct.UserMessageSendCall.html) //! * [*drafts update users*](struct.UserDraftUpdateCall.html) +//! * [*messages send users*](struct.UserMessageSendCall.html) //! * [*messages insert users*](struct.UserMessageInsertCall.html) //! //! @@ -118,9 +118,9 @@ //! // Values shown here are possibly random and not representative ! //! let result = hub.users().messages_import(req, "userId") //! .process_for_calendar(true) -//! .never_mark_spam(false) -//! .internal_date_source("nonumy") -//! .deleted(true) +//! .never_mark_spam(true) +//! .internal_date_source("sanctus") +//! .deleted(false) //! .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); //! //! match result { diff --git a/gen/gmail1/src/lib.rs.in b/gen/gmail1/src/lib.rs.in index 6d61c022d9..8ad9d08c97 100644 --- a/gen/gmail1/src/lib.rs.in +++ b/gen/gmail1/src/lib.rs.in @@ -303,30 +303,6 @@ impl RequestValue for Label {} impl ResponseResult for Label {} -/// 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*). -/// -/// * [history list users](struct.UserHistoryListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListHistoryResponse { - /// Page token to retrieve the next page of results in the list. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The ID of the mailbox's current history record. - #[serde(rename="historyId")] - pub history_id: Option, - /// List of history records. Any messages contained in the response will typically only have id and threadId fields populated. - pub history: Option>, -} - -impl ResponseResult for ListHistoryResponse {} - - /// A draft email in the user's mailbox. /// /// # Activities @@ -506,6 +482,24 @@ pub struct HistoryLabelAdded { impl Part for HistoryLabelAdded {} +/// 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*). +/// +/// * [labels list users](struct.UserLabelListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListLabelsResponse { + /// List of labels. + pub labels: Option>, +} + +impl ResponseResult for ListLabelsResponse {} + + /// There is no detailed description. /// /// # Activities @@ -552,6 +546,33 @@ pub struct ModifyThreadRequest { impl RequestValue for ModifyThreadRequest {} +/// Set up or update a new push notification watch on this user's mailbox. +/// +/// # 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*). +/// +/// * [watch users](struct.UserWatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WatchRequest { + /// List of label_ids to restrict notifications about. By default, if unspecified, all changes are pushed out. If specified then dictates which labels are required for a push notification to be generated. + #[serde(rename="labelIds")] + pub label_ids: Option>, + /// A fully qualified Google Cloud Pub/Sub API topic name to publish the events to. This topic name **must** already exist in Cloud Pub/Sub and you **must** have already granted gmail "publish" permission on it. For example, "projects/my-project-identifier/topics/my-topic-name" (using the new Cloud Pub/Sub "v1beta2" topic naming format). + /// + /// Note that the "my-project-identifier" portion must exactly match your Google developer project id (the one executing this watch request). + #[serde(rename="topicName")] + pub topic_name: Option, + /// Filtering behavior of labelIds list specified. + #[serde(rename="labelFilterAction")] + pub label_filter_action: Option, +} + +impl RequestValue for WatchRequest {} + + /// There is no detailed description. /// /// # Activities @@ -583,15 +604,37 @@ impl ResponseResult for ListMessagesResponse {} /// 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*). /// -/// * [labels list users](struct.UserLabelListCall.html) (response) +/// * [history list users](struct.UserHistoryListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListLabelsResponse { - /// List of labels. - pub labels: Option>, +pub struct ListHistoryResponse { + /// Page token to retrieve the next page of results in the list. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The ID of the mailbox's current history record. + #[serde(rename="historyId")] + pub history_id: Option, + /// List of history records. Any messages contained in the response will typically only have id and threadId fields populated. + pub history: Option>, } -impl ResponseResult for ListLabelsResponse {} +impl ResponseResult for ListHistoryResponse {} + + +/// 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 HistoryLabelRemoved { + /// Label IDs removed from the message. + #[serde(rename="labelIds")] + pub label_ids: Option>, + /// no description provided + pub message: Option, +} + +impl Part for HistoryLabelRemoved {} /// An email message. @@ -612,6 +655,9 @@ impl ResponseResult for ListLabelsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Message { + /// The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. + #[serde(rename="internalDate")] + pub internal_date: Option, /// The ID of the last history record that modified this message. #[serde(rename="historyId")] pub history_id: Option, @@ -641,20 +687,25 @@ impl RequestValue for Message {} impl ResponseResult for Message {} -/// There is no detailed description. +/// Push notification watch response. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # 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*). +/// +/// * [watch users](struct.UserWatchCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HistoryLabelRemoved { - /// Label IDs removed from the message. - #[serde(rename="labelIds")] - pub label_ids: Option>, - /// no description provided - pub message: Option, +pub struct WatchResponse { + /// When Gmail will stop sending notifications for mailbox updates (epoch millis). Call watch again before this time to renew the watch. + pub expiration: Option, + /// The ID of the mailbox's current history record. + #[serde(rename="historyId")] + pub history_id: Option, } -impl Part for HistoryLabelRemoved {} +impl ResponseResult for WatchResponse {} @@ -685,7 +736,7 @@ impl Part for HistoryLabelRemoved {} /// ::default(), None); /// let mut hub = Gmail::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `drafts_create(...)`, `drafts_delete(...)`, `drafts_get(...)`, `drafts_list(...)`, `drafts_send(...)`, `drafts_update(...)`, `get_profile(...)`, `history_list(...)`, `labels_create(...)`, `labels_delete(...)`, `labels_get(...)`, `labels_list(...)`, `labels_patch(...)`, `labels_update(...)`, `messages_attachments_get(...)`, `messages_delete(...)`, `messages_get(...)`, `messages_import(...)`, `messages_insert(...)`, `messages_list(...)`, `messages_modify(...)`, `messages_send(...)`, `messages_trash(...)`, `messages_untrash(...)`, `threads_delete(...)`, `threads_get(...)`, `threads_list(...)`, `threads_modify(...)`, `threads_trash(...)` and `threads_untrash(...)` +/// // like `drafts_create(...)`, `drafts_delete(...)`, `drafts_get(...)`, `drafts_list(...)`, `drafts_send(...)`, `drafts_update(...)`, `get_profile(...)`, `history_list(...)`, `labels_create(...)`, `labels_delete(...)`, `labels_get(...)`, `labels_list(...)`, `labels_patch(...)`, `labels_update(...)`, `messages_attachments_get(...)`, `messages_delete(...)`, `messages_get(...)`, `messages_import(...)`, `messages_insert(...)`, `messages_list(...)`, `messages_modify(...)`, `messages_send(...)`, `messages_trash(...)`, `messages_untrash(...)`, `stop(...)`, `threads_delete(...)`, `threads_get(...)`, `threads_list(...)`, `threads_modify(...)`, `threads_trash(...)`, `threads_untrash(...)` and `watch(...)` /// // to build up your call. /// let rb = hub.users(); /// # } @@ -700,6 +751,23 @@ impl<'a, C, A> MethodsBuilder for UserMethods<'a, C, A> {} impl<'a, C, A> UserMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Stop receiving push notifications for the given user mailbox. + /// + /// # Arguments + /// + /// * `userId` - The user's email address. The special value me can be used to indicate the authenticated user. + pub fn stop(&self, user_id: &str) -> UserStopCall<'a, C, A> { + UserStopCall { + hub: self.hub, + _user_id: user_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message. @@ -1157,6 +1225,25 @@ impl<'a, C, A> UserMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Set up or update a push notification watch on the given user mailbox. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `userId` - The user's email address. The special value me can be used to indicate the authenticated user. + pub fn watch(&self, request: WatchRequest, user_id: &str) -> UserWatchCall<'a, C, A> { + UserWatchCall { + hub: self.hub, + _request: request, + _user_id: user_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists the drafts in the user's mailbox. @@ -1306,6 +1393,231 @@ impl<'a, C, A> UserMethods<'a, C, A> { // CallBuilders ### // ################# +/// Stop receiving push notifications for the given user mailbox. +/// +/// A builder for the *stop* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_gmail1 as gmail1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use gmail1::Gmail; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Gmail::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.users().stop("userId") +/// .doit(); +/// # } +/// ``` +pub struct UserStopCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Gmail, + _user_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserStopCall<'a, C, A> {} + +impl<'a, C, A> UserStopCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + 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: "gmail.users.stop", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("userId", self._user_id.to_string())); + for &field in ["userId"].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())); + } + + + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/stop".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{userId}", "userId")].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 ["userId"].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::Post, &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 = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The user's email address. The special value me can be used to indicate the authenticated user. + /// + /// Sets the *user 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 user_id(mut self, new_value: &str) -> UserStopCall<'a, C, A> { + self._user_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) -> UserStopCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserStopCall<'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::Gmai`. + /// + /// 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) -> UserStopCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message. /// /// A builder for the *messages.import* method supported by a *user* resource. @@ -1340,10 +1652,10 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().messages_import(req, "userId") -/// .process_for_calendar(false) +/// .process_for_calendar(true) /// .never_mark_spam(true) -/// .internal_date_source("sea") -/// .deleted(false) +/// .internal_date_source("nonumy") +/// .deleted(true) /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -1765,10 +2077,10 @@ impl<'a, C, A> UserMessageImportCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().history_list("userId") -/// .start_history_id("gubergren") -/// .page_token("sadipscing") -/// .max_results(70) -/// .label_id("ea") +/// .start_history_id("sadipscing") +/// .page_token("aliquyam") +/// .max_results(35) +/// .label_id("no") /// .doit(); /// # } /// ``` @@ -1942,7 +2254,7 @@ impl<'a, C, A> UserHistoryListCall<'a, C, A> where C: BorrowMut, self._user_id = new_value.to_string(); self } - /// Required. Returns history records after the specified startHistoryId. The supplied startHistoryId should be obtained from the historyId of a message, thread, or previous list response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId typically returns an HTTP 404 error code. A historyId is typically valid for at least a week, but in some circumstances may be valid for only a few hours. If you receive an HTTP 404 error response, your application should perform a full sync. If you receive no nextPageToken in the response, there are no updates to retrieve and you can store the returned historyId for a future request. + /// Required. Returns history records after the specified startHistoryId. The supplied startHistoryId should be obtained from the historyId of a message, thread, or previous list response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId typically returns an HTTP 404 error code. A historyId is typically valid for at least a week, but in some rare circumstances may be valid for only a few hours. If you receive an HTTP 404 error response, your application should perform a full sync. If you receive no nextPageToken in the response, there are no updates to retrieve and you can store the returned historyId for a future request. /// /// Sets the *start history id* query property to the given value. pub fn start_history_id(mut self, new_value: &str) -> UserHistoryListCall<'a, C, A> { @@ -4934,7 +5246,7 @@ impl<'a, C, A> UserDraftUpdateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().drafts_get("userId", "id") -/// .format("elitr") +/// .format("amet") /// .doit(); /// # } /// ``` @@ -6237,11 +6549,11 @@ impl<'a, C, A> UserDraftDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().threads_list("userId") -/// .q("sea") -/// .page_token("et") -/// .max_results(31) -/// .add_label_ids("et") -/// .include_spam_trash(true) +/// .q("et") +/// .page_token("duo") +/// .max_results(80) +/// .add_label_ids("eirmod") +/// .include_spam_trash(false) /// .doit(); /// # } /// ``` @@ -7814,6 +8126,273 @@ impl<'a, C, A> UserThreadTrashCall<'a, C, A> where C: BorrowMut, } +/// Set up or update a push notification watch on the given user mailbox. +/// +/// A builder for the *watch* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_gmail1 as gmail1; +/// use gmail1::WatchRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use gmail1::Gmail; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Gmail::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 = WatchRequest::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.users().watch(req, "userId") +/// .doit(); +/// # } +/// ``` +pub struct UserWatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Gmail, + _request: WatchRequest, + _user_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserWatchCall<'a, C, A> {} + +impl<'a, C, A> UserWatchCall<'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, WatchResponse)> { + 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: "gmail.users.watch", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "userId"].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://www.googleapis.com/gmail/v1/users/{userId}/watch".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{userId}", "userId")].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 ["userId"].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: WatchRequest) -> UserWatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The user's email address. The special value me can be used to indicate the authenticated user. + /// + /// Sets the *user 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 user_id(mut self, new_value: &str) -> UserWatchCall<'a, C, A> { + self._user_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) -> UserWatchCall<'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 + /// + /// * *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. Overrides userIp if both are provided. + /// * *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. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserWatchCall<'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::Gmai`. + /// + /// 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) -> UserWatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Lists the drafts in the user's mailbox. /// /// A builder for the *drafts.list* method supported by a *user* resource. @@ -7841,8 +8420,8 @@ impl<'a, C, A> UserThreadTrashCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().drafts_list("userId") -/// .page_token("consetetur") -/// .max_results(49) +/// .page_token("voluptua.") +/// .max_results(45) /// .doit(); /// # } /// ``` @@ -8485,8 +9064,8 @@ impl<'a, C, A> UserMessageSendCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().messages_get("userId", "id") -/// .add_metadata_headers("justo") -/// .format("sit") +/// .add_metadata_headers("vero") +/// .format("diam") /// .doit(); /// # } /// ``` @@ -8762,9 +9341,9 @@ impl<'a, C, A> UserMessageGetCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().messages_list("userId") -/// .q("diam") -/// .page_token("rebum.") -/// .max_results(56) +/// .q("consetetur") +/// .page_token("sadipscing") +/// .max_results(25) /// .add_label_ids("sadipscing") /// .include_spam_trash(false) /// .doit(); @@ -9299,8 +9878,8 @@ impl<'a, C, A> UserGetProfileCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().threads_get("userId", "id") -/// .add_metadata_headers("dolore") -/// .format("duo") +/// .add_metadata_headers("aliquyam") +/// .format("Lorem") /// .doit(); /// # } /// ``` @@ -9583,7 +10162,7 @@ impl<'a, C, A> UserThreadGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().messages_insert(req, "userId") -/// .internal_date_source("Lorem") +/// .internal_date_source("clita") /// .deleted(true) /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } diff --git a/gen/groupsmigration1-cli/Cargo.toml b/gen/groupsmigration1-cli/Cargo.toml index a2f5888556..6b4ddbe531 100644 --- a/gen/groupsmigration1-cli/Cargo.toml +++ b/gen/groupsmigration1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["groupsmigration", "google", "cli"] name = "groupsmigration1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/groupsmigration1-cli/src/main.rs b/gen/groupsmigration1-cli/src/main.rs index 8255ad28ad..0c2559f5ad 100644 --- a/gen/groupsmigration1-cli/src/main.rs +++ b/gen/groupsmigration1-cli/src/main.rs @@ -93,6 +93,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -149,7 +150,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() @@ -162,7 +163,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() diff --git a/gen/groupsmigration1/Cargo.toml b/gen/groupsmigration1/Cargo.toml index 2377f783ae..b09c1e4a64 100644 --- a/gen/groupsmigration1/Cargo.toml +++ b/gen/groupsmigration1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/groupsmigration1/src/cmn.rs b/gen/groupsmigration1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/groupsmigration1/src/cmn.rs +++ b/gen/groupsmigration1/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/groupssettings1-cli/Cargo.toml b/gen/groupssettings1-cli/Cargo.toml index 70b49d1e1b..9427985685 100644 --- a/gen/groupssettings1-cli/Cargo.toml +++ b/gen/groupssettings1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["groupssettings", "google", "cli"] name = "groupssettings1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/groupssettings1-cli/src/main.rs b/gen/groupssettings1-cli/src/main.rs index 454d43ec6d..27d72efe81 100644 --- a/gen/groupssettings1-cli/src/main.rs +++ b/gen/groupssettings1-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -200,6 +201,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -311,6 +313,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -373,7 +376,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() @@ -386,7 +389,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() diff --git a/gen/groupssettings1/Cargo.toml b/gen/groupssettings1/Cargo.toml index 1bb04a759d..2bb862544b 100644 --- a/gen/groupssettings1/Cargo.toml +++ b/gen/groupssettings1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/groupssettings1/src/cmn.rs b/gen/groupssettings1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/groupssettings1/src/cmn.rs +++ b/gen/groupssettings1/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/identitytoolkit3-cli/Cargo.toml b/gen/identitytoolkit3-cli/Cargo.toml index 8b36eb5289..b1baac8814 100644 --- a/gen/identitytoolkit3-cli/Cargo.toml +++ b/gen/identitytoolkit3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-identitytoolkit3-cli" -version = "0.3.0+20150406" +version = "0.3.0+20150513" authors = ["Sebastian Thiel "] description = "A complete library to interact with Identity Toolkit (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/identitytoolkit3-cli" @@ -17,8 +17,8 @@ keywords = ["identitytoolkit", "google", "cli"] name = "identitytoolkit3" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/identitytoolkit3-cli/README.md b/gen/identitytoolkit3-cli/README.md index b403061838..7e9af48291 100644 --- a/gen/identitytoolkit3-cli/README.md +++ b/gen/identitytoolkit3-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Identity Toolkit* API at revision *20150406*. The CLI is at version *0.3.0*. +This documentation was generated from the *Identity Toolkit* API at revision *20150513*. The CLI is at version *0.3.0*. ```bash identitytoolkit3 [options] diff --git a/gen/identitytoolkit3-cli/mkdocs.yml b/gen/identitytoolkit3-cli/mkdocs.yml index 7fe5649cdc..5acf7e5b35 100644 --- a/gen/identitytoolkit3-cli/mkdocs.yml +++ b/gen/identitytoolkit3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Identity Toolkit v0.3.0+20150406 +site_name: Identity Toolkit v0.3.0+20150513 site_url: http://byron.github.io/google-apis-rs/google-identitytoolkit3-cli site_description: Write integrating applications with bcore diff --git a/gen/identitytoolkit3-cli/src/main.rs b/gen/identitytoolkit3-cli/src/main.rs index 0a0da7ef67..28983b7955 100644 --- a/gen/identitytoolkit3-cli/src/main.rs +++ b/gen/identitytoolkit3-cli/src/main.rs @@ -128,6 +128,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -209,6 +210,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -291,6 +293,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -374,6 +377,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -462,6 +466,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -510,6 +515,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -558,6 +564,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -642,6 +649,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -673,17 +681,19 @@ impl<'n, 'a> Engine<'n, 'a> { match &temp_cursor.to_string()[..] { "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "local-id" => Some(("localId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "valid-since" => Some(("validSince", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "upgrade-to-federated-login" => Some(("upgradeToFederatedLogin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "captcha-response" => Some(("captchaResponse", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id-token" => Some(("idToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "provider" => Some(("provider", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "captcha-challenge" => Some(("captchaChallenge", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "email-verified" => Some(("emailVerified", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "provider" => Some(("provider", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "disable-user" => Some(("disableUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "captcha-challenge" => Some(("captchaChallenge", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id-token" => Some(("idToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "oob-code" => Some(("oobCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "password" => Some(("password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "email" => Some(("email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["captcha-challenge", "captcha-response", "display-name", "email", "email-verified", "id-token", "local-id", "oob-code", "password", "provider", "upgrade-to-federated-login"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["captcha-challenge", "captcha-response", "disable-user", "display-name", "email", "email-verified", "id-token", "local-id", "oob-code", "password", "provider", "upgrade-to-federated-login", "valid-since"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -733,6 +743,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -818,6 +829,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -902,6 +914,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -987,6 +1000,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1076,7 +1090,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() @@ -1089,7 +1103,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() @@ -1383,7 +1397,7 @@ fn main() { let mut app = App::new("identitytoolkit3") .author("Sebastian Thiel ") - .version("0.3.0+20150406") + .version("0.3.0+20150513") .about("Help the third party sites to implement federated login.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_identitytoolkit3_cli") .arg(Arg::with_name("folder") diff --git a/gen/identitytoolkit3/Cargo.toml b/gen/identitytoolkit3/Cargo.toml index dc5c213776..0e951b92cf 100644 --- a/gen/identitytoolkit3/Cargo.toml +++ b/gen/identitytoolkit3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-identitytoolkit3" -version = "0.1.8+20150406" +version = "0.1.8+20150513" authors = ["Sebastian Thiel "] description = "A complete library to interact with Identity Toolkit (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/identitytoolkit3" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/identitytoolkit3/README.md b/gen/identitytoolkit3/README.md index 95f5f3c414..fbf90f3302 100644 --- a/gen/identitytoolkit3/README.md +++ b/gen/identitytoolkit3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-identitytoolkit3` library allows access to all features of the *Google Identity Toolkit* service. -This documentation was generated from *Identity Toolkit* crate version *0.1.8+20150406*, where *20150406* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Identity Toolkit* crate version *0.1.8+20150513*, where *20150513* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *Identity Toolkit* *v3* API can be found at the [official documentation site](https://developers.google.com/identity-toolkit/v3/). diff --git a/gen/identitytoolkit3/src/cmn.rs b/gen/identitytoolkit3/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/identitytoolkit3/src/cmn.rs +++ b/gen/identitytoolkit3/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/identitytoolkit3/src/lib.rs b/gen/identitytoolkit3/src/lib.rs index 9f4f1fbed7..ff38503fed 100644 --- a/gen/identitytoolkit3/src/lib.rs +++ b/gen/identitytoolkit3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Identity Toolkit* crate version *0.1.8+20150406*, where *20150406* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Identity Toolkit* crate version *0.1.8+20150513*, where *20150513* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *Identity Toolkit* *v3* API can be found at the //! [official documentation site](https://developers.google.com/identity-toolkit/v3/). diff --git a/gen/identitytoolkit3/src/lib.rs.in b/gen/identitytoolkit3/src/lib.rs.in index 6e3eaeb6a5..eddcd044e8 100644 --- a/gen/identitytoolkit3/src/lib.rs.in +++ b/gen/identitytoolkit3/src/lib.rs.in @@ -218,21 +218,27 @@ pub struct IdentitytoolkitRelyingpartySetAccountInfoRequest { /// The local ID of the user. #[serde(rename="localId")] pub local_id: Option, + /// Timestamp in seconds for valid login token. + #[serde(rename="validSince")] + pub valid_since: Option, /// Mark the user to upgrade to federated login. #[serde(rename="upgradeToFederatedLogin")] pub upgrade_to_federated_login: Option, /// Response to the captcha. #[serde(rename="captchaResponse")] pub captcha_response: Option, - /// The GITKit token of the authenticated user. - #[serde(rename="idToken")] - pub id_token: Option, /// Mark the email as verified or not. #[serde(rename="emailVerified")] pub email_verified: Option, + /// Whether to disable the user. + #[serde(rename="disableUser")] + pub disable_user: Option, /// The captcha challenge. #[serde(rename="captchaChallenge")] pub captcha_challenge: Option, + /// The GITKit token of the authenticated user. + #[serde(rename="idToken")] + pub id_token: Option, /// The associated IDPs of the user. pub provider: Option>, /// The out-of-band code of the change email request. @@ -750,6 +756,9 @@ pub struct UserInfo { /// The local ID of the user. #[serde(rename="localId")] pub local_id: Option, + /// Timestamp in seconds for valid login token. + #[serde(rename="validSince")] + pub valid_since: Option, /// The URL of the user profile photo. #[serde(rename="photoUrl")] pub photo_url: Option, @@ -759,6 +768,8 @@ pub struct UserInfo { /// The user's hashed password. #[serde(rename="passwordHash")] pub password_hash: Option, + /// Whether the user is disabled. + pub disabled: Option, /// Version of the user's password. pub version: Option, /// The IDP of the user. diff --git a/gen/licensing1-cli/Cargo.toml b/gen/licensing1-cli/Cargo.toml index 7dfaff86ae..e66f4bf4e9 100644 --- a/gen/licensing1-cli/Cargo.toml +++ b/gen/licensing1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-licensing1-cli" -version = "0.3.0+20140122" +version = "0.3.0+20150525" authors = ["Sebastian Thiel "] description = "A complete library to interact with licensing (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/licensing1-cli" @@ -17,8 +17,8 @@ keywords = ["licensing", "google", "cli"] name = "licensing1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/licensing1-cli/README.md b/gen/licensing1-cli/README.md index 68caeb289a..3c8bf54ade 100644 --- a/gen/licensing1-cli/README.md +++ b/gen/licensing1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *licensing* API at revision *20140122*. The CLI is at version *0.3.0*. +This documentation was generated from the *licensing* API at revision *20150525*. The CLI is at version *0.3.0*. ```bash licensing1 [options] diff --git a/gen/licensing1-cli/mkdocs.yml b/gen/licensing1-cli/mkdocs.yml index 11ca52b9b7..88be8c2ac4 100644 --- a/gen/licensing1-cli/mkdocs.yml +++ b/gen/licensing1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: licensing v0.3.0+20140122 +site_name: licensing v0.3.0+20150525 site_url: http://byron.github.io/google-apis-rs/google-licensing1-cli site_description: Write integrating applications with bcore diff --git a/gen/licensing1-cli/src/main.rs b/gen/licensing1-cli/src/main.rs index aa4d5e08ed..e22f3ae3f3 100644 --- a/gen/licensing1-cli/src/main.rs +++ b/gen/licensing1-cli/src/main.rs @@ -133,6 +133,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -217,6 +218,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -275,6 +277,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -333,6 +336,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -422,6 +426,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -511,6 +516,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -585,7 +591,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() @@ -598,7 +604,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() @@ -878,7 +884,7 @@ fn main() { let mut app = App::new("licensing1") .author("Sebastian Thiel ") - .version("0.3.0+20140122") + .version("0.3.0+20150525") .about("Licensing API to view and manage license for your domain.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_licensing1_cli") .arg(Arg::with_name("url") diff --git a/gen/licensing1/Cargo.toml b/gen/licensing1/Cargo.toml index 83f8da63b4..71bc8cc240 100644 --- a/gen/licensing1/Cargo.toml +++ b/gen/licensing1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-licensing1" -version = "0.1.8+20140122" +version = "0.1.8+20150525" authors = ["Sebastian Thiel "] description = "A complete library to interact with licensing (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/licensing1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/licensing1/README.md b/gen/licensing1/README.md index 9d473b9e1d..c00207c9b3 100644 --- a/gen/licensing1/README.md +++ b/gen/licensing1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-licensing1` library allows access to all features of the *Google licensing* service. -This documentation was generated from *licensing* crate version *0.1.8+20140122*, where *20140122* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *licensing* crate version *0.1.8+20150525*, where *20150525* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *licensing* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/licensing/). diff --git a/gen/licensing1/src/cmn.rs b/gen/licensing1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/licensing1/src/cmn.rs +++ b/gen/licensing1/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/licensing1/src/lib.rs b/gen/licensing1/src/lib.rs index 701a338b12..f429e7cdf6 100644 --- a/gen/licensing1/src/lib.rs +++ b/gen/licensing1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *licensing* crate version *0.1.8+20140122*, where *20140122* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *licensing* crate version *0.1.8+20150525*, where *20150525* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *licensing* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/licensing/). diff --git a/gen/logging1_beta3-cli/Cargo.toml b/gen/logging1_beta3-cli/Cargo.toml index c0c9eaa0dc..e2d46cd1eb 100644 --- a/gen/logging1_beta3-cli/Cargo.toml +++ b/gen/logging1_beta3-cli/Cargo.toml @@ -16,8 +16,8 @@ keywords = ["logging", "google", "cli"] name = "logging1-beta3" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/logging1_beta3-cli/src/main.rs b/gen/logging1_beta3-cli/src/main.rs index b53beef687..9bdaa58c36 100644 --- a/gen/logging1_beta3-cli/src/main.rs +++ b/gen/logging1_beta3-cli/src/main.rs @@ -105,6 +105,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -166,6 +167,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -251,6 +253,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -302,6 +305,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -353,6 +357,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -404,6 +409,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -489,6 +495,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -540,6 +547,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -624,6 +632,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -688,6 +697,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -773,6 +783,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -824,6 +835,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -875,6 +887,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -926,6 +939,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1011,6 +1025,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1109,7 +1124,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() @@ -1122,7 +1137,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() diff --git a/gen/logging1_beta3/Cargo.toml b/gen/logging1_beta3/Cargo.toml index 096775b74c..2e87b90854 100644 --- a/gen/logging1_beta3/Cargo.toml +++ b/gen/logging1_beta3/Cargo.toml @@ -15,8 +15,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/logging1_beta3/src/cmn.rs b/gen/logging1_beta3/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/logging1_beta3/src/cmn.rs +++ b/gen/logging1_beta3/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/manager1_beta2-cli/Cargo.toml b/gen/manager1_beta2-cli/Cargo.toml index 566e66b141..67907d43a6 100644 --- a/gen/manager1_beta2-cli/Cargo.toml +++ b/gen/manager1_beta2-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["manager", "google", "cli"] name = "manager1-beta2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/manager1_beta2-cli/src/main.rs b/gen/manager1_beta2-cli/src/main.rs index 66f5a0ff46..99ce23e2b7 100644 --- a/gen/manager1_beta2-cli/src/main.rs +++ b/gen/manager1_beta2-cli/src/main.rs @@ -133,6 +133,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -222,6 +223,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -280,6 +282,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -375,6 +378,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -460,6 +464,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -518,6 +523,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -603,7 +609,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() @@ -616,7 +622,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() diff --git a/gen/manager1_beta2/Cargo.toml b/gen/manager1_beta2/Cargo.toml index 2c057650a6..9bde318a75 100644 --- a/gen/manager1_beta2/Cargo.toml +++ b/gen/manager1_beta2/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/manager1_beta2/src/cmn.rs b/gen/manager1_beta2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/manager1_beta2/src/cmn.rs +++ b/gen/manager1_beta2/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/mapsengine1-cli/Cargo.toml b/gen/mapsengine1-cli/Cargo.toml index ed18b1ceb1..37aa6a6452 100644 --- a/gen/mapsengine1-cli/Cargo.toml +++ b/gen/mapsengine1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-mapsengine1-cli" -version = "0.3.0+20150414" +version = "0.3.0+20150611" authors = ["Sebastian Thiel "] description = "A complete library to interact with Maps Engine (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mapsengine1-cli" @@ -17,8 +17,8 @@ keywords = ["mapsengine", "google", "cli"] name = "mapsengine1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/mapsengine1-cli/README.md b/gen/mapsengine1-cli/README.md index 8f7c6db7c6..63637552e4 100644 --- a/gen/mapsengine1-cli/README.md +++ b/gen/mapsengine1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Maps Engine* API at revision *20150414*. The CLI is at version *0.3.0*. +This documentation was generated from the *Maps Engine* API at revision *20150611*. The CLI is at version *0.3.0*. ```bash mapsengine1 [options] diff --git a/gen/mapsengine1-cli/mkdocs.yml b/gen/mapsengine1-cli/mkdocs.yml index 57552c30a7..f2c10e70f3 100644 --- a/gen/mapsengine1-cli/mkdocs.yml +++ b/gen/mapsengine1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Maps Engine v0.3.0+20150414 +site_name: Maps Engine v0.3.0+20150611 site_url: http://byron.github.io/google-apis-rs/google-mapsengine1-cli site_description: Write integrating applications with bcore diff --git a/gen/mapsengine1-cli/src/main.rs b/gen/mapsengine1-cli/src/main.rs index 09b183cccf..dee2d39cad 100644 --- a/gen/mapsengine1-cli/src/main.rs +++ b/gen/mapsengine1-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -180,6 +181,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -238,6 +240,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -289,6 +292,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -340,6 +344,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -446,6 +451,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -545,6 +551,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -596,6 +603,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -687,6 +695,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -748,6 +757,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -806,6 +816,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -985,6 +996,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1068,6 +1080,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1119,6 +1132,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1170,6 +1184,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1225,6 +1240,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1276,6 +1292,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1375,6 +1392,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1474,6 +1492,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1525,6 +1544,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1616,6 +1636,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1677,6 +1698,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1853,6 +1875,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1936,6 +1959,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1987,6 +2011,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2042,6 +2067,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2093,6 +2119,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2183,6 +2210,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2239,8 +2267,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -2300,6 +2330,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2351,6 +2382,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2402,6 +2434,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2501,6 +2534,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2596,6 +2630,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2687,6 +2722,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2745,6 +2781,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2921,6 +2958,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3004,6 +3042,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3055,6 +3094,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3106,6 +3146,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3190,6 +3231,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3274,6 +3316,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3359,6 +3402,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3502,6 +3546,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3590,6 +3635,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3648,6 +3694,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3827,6 +3874,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3910,6 +3958,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3961,6 +4010,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4012,6 +4062,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4114,6 +4165,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4214,6 +4266,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4548,6 +4601,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4627,6 +4681,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4730,6 +4785,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4821,6 +4877,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4879,6 +4936,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5056,6 +5114,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5139,6 +5198,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5190,6 +5250,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5241,6 +5302,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5341,6 +5403,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5673,7 +5736,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() @@ -5686,7 +5749,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() @@ -7510,7 +7573,7 @@ fn main() { let mut app = App::new("mapsengine1") .author("Sebastian Thiel ") - .version("0.3.0+20150414") + .version("0.3.0+20150611") .about("The Google Maps Engine API allows developers to store and query geospatial vector and raster data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_mapsengine1_cli") .arg(Arg::with_name("url") diff --git a/gen/mapsengine1/Cargo.toml b/gen/mapsengine1/Cargo.toml index 117d5ecee4..93112d4f3f 100644 --- a/gen/mapsengine1/Cargo.toml +++ b/gen/mapsengine1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-mapsengine1" -version = "0.1.8+20150414" +version = "0.1.8+20150611" authors = ["Sebastian Thiel "] description = "A complete library to interact with Maps Engine (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mapsengine1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/mapsengine1/README.md b/gen/mapsengine1/README.md index 5ff458fffe..5d868bed5f 100644 --- a/gen/mapsengine1/README.md +++ b/gen/mapsengine1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-mapsengine1` library allows access to all features of the *Google Maps Engine* service. -This documentation was generated from *Maps Engine* crate version *0.1.8+20150414*, where *20150414* is the exact revision of the *mapsengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Maps Engine* crate version *0.1.8+20150611*, where *20150611* is the exact revision of the *mapsengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *Maps Engine* *v1* API can be found at the [official documentation site](https://developers.google.com/maps-engine/). diff --git a/gen/mapsengine1/src/cmn.rs b/gen/mapsengine1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/mapsengine1/src/cmn.rs +++ b/gen/mapsengine1/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/mapsengine1/src/lib.rs b/gen/mapsengine1/src/lib.rs index 3cc4047bff..937838b956 100644 --- a/gen/mapsengine1/src/lib.rs +++ b/gen/mapsengine1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Maps Engine* crate version *0.1.8+20150414*, where *20150414* is the exact revision of the *mapsengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Maps Engine* crate version *0.1.8+20150611*, where *20150611* is the exact revision of the *mapsengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *Maps Engine* *v1* API can be found at the //! [official documentation site](https://developers.google.com/maps-engine/). diff --git a/gen/mirror1-cli/Cargo.toml b/gen/mirror1-cli/Cargo.toml index b91409f0a1..2aac1d9297 100644 --- a/gen/mirror1-cli/Cargo.toml +++ b/gen/mirror1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-mirror1-cli" -version = "0.3.0+20150220" +version = "0.3.0+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with mirror (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mirror1-cli" @@ -17,8 +17,8 @@ keywords = ["mirror", "google", "cli"] name = "mirror1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/mirror1-cli/README.md b/gen/mirror1-cli/README.md index e9919939a7..bee276903e 100644 --- a/gen/mirror1-cli/README.md +++ b/gen/mirror1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *mirror* API at revision *20150220*. The CLI is at version *0.3.0*. +This documentation was generated from the *mirror* API at revision *20150326*. The CLI is at version *0.3.0*. ```bash mirror1 [options] diff --git a/gen/mirror1-cli/mkdocs.yml b/gen/mirror1-cli/mkdocs.yml index df115a7432..51be36a4d7 100644 --- a/gen/mirror1-cli/mkdocs.yml +++ b/gen/mirror1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: mirror v0.3.0+20150220 +site_name: mirror v0.3.0+20150326 site_url: http://byron.github.io/google-apis-rs/google-mirror1-cli site_description: Write integrating applications with bcore diff --git a/gen/mirror1-cli/src/main.rs b/gen/mirror1-cli/src/main.rs index f4261e5a83..51cc7e3708 100644 --- a/gen/mirror1-cli/src/main.rs +++ b/gen/mirror1-cli/src/main.rs @@ -120,6 +120,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -215,6 +216,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -309,6 +311,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -360,6 +363,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -454,6 +458,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -548,6 +553,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -599,6 +605,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -650,6 +657,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -701,6 +709,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -841,6 +850,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -892,6 +902,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -988,6 +999,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1088,8 +1100,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -1146,6 +1160,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1197,6 +1212,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1292,6 +1308,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1420,6 +1437,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1493,6 +1511,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1617,6 +1636,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1745,6 +1765,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1910,7 +1931,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() @@ -1923,7 +1944,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() @@ -2541,7 +2562,7 @@ fn main() { let mut app = App::new("mirror1") .author("Sebastian Thiel ") - .version("0.3.0+20150220") + .version("0.3.0+20150326") .about("API for interacting with Glass users via the timeline.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_mirror1_cli") .arg(Arg::with_name("url") diff --git a/gen/mirror1/Cargo.toml b/gen/mirror1/Cargo.toml index 8857e8cc73..bb6dbc7a3e 100644 --- a/gen/mirror1/Cargo.toml +++ b/gen/mirror1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-mirror1" -version = "0.1.8+20150220" +version = "0.1.8+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with mirror (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mirror1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/mirror1/README.md b/gen/mirror1/README.md index 731bbf3462..3848aa5c6b 100644 --- a/gen/mirror1/README.md +++ b/gen/mirror1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-mirror1` library allows access to all features of the *Google mirror* service. -This documentation was generated from *mirror* crate version *0.1.8+20150220*, where *20150220* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *mirror* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *mirror* *v1* API can be found at the [official documentation site](https://developers.google.com/glass). diff --git a/gen/mirror1/src/cmn.rs b/gen/mirror1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/mirror1/src/cmn.rs +++ b/gen/mirror1/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/mirror1/src/lib.rs b/gen/mirror1/src/lib.rs index b29fcb0997..3ec556e865 100644 --- a/gen/mirror1/src/lib.rs +++ b/gen/mirror1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *mirror* crate version *0.1.8+20150220*, where *20150220* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *mirror* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *mirror* *v1* API can be found at the //! [official documentation site](https://developers.google.com/glass). diff --git a/gen/oauth2_v2-cli/Cargo.toml b/gen/oauth2_v2-cli/Cargo.toml index e3eb5228a6..468fe78ce8 100644 --- a/gen/oauth2_v2-cli/Cargo.toml +++ b/gen/oauth2_v2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-oauth2_v2-cli" -version = "0.3.0+20150416" +version = "0.3.0+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with oauth2 (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/oauth2_v2-cli" @@ -17,8 +17,8 @@ keywords = ["oauth2", "google", "cli"] name = "oauth2-v2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/oauth2_v2-cli/README.md b/gen/oauth2_v2-cli/README.md index 6a8084e18f..2f0f02b856 100644 --- a/gen/oauth2_v2-cli/README.md +++ b/gen/oauth2_v2-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *oauth2* API at revision *20150416*. The CLI is at version *0.3.0*. +This documentation was generated from the *oauth2* API at revision *20150526*. The CLI is at version *0.3.0*. ```bash oauth2-v2 [options] diff --git a/gen/oauth2_v2-cli/mkdocs.yml b/gen/oauth2_v2-cli/mkdocs.yml index e81e20be3a..051efee405 100644 --- a/gen/oauth2_v2-cli/mkdocs.yml +++ b/gen/oauth2_v2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: oauth2 v0.3.0+20150416 +site_name: oauth2 v0.3.0+20150526 site_url: http://byron.github.io/google-apis-rs/google-oauth2_v2-cli site_description: Write integrating applications with bcore diff --git a/gen/oauth2_v2-cli/src/main.rs b/gen/oauth2_v2-cli/src/main.rs index ea46a11a96..ee2e13fb4d 100644 --- a/gen/oauth2_v2-cli/src/main.rs +++ b/gen/oauth2_v2-cli/src/main.rs @@ -86,6 +86,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -144,6 +145,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -195,6 +197,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -246,6 +249,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -319,7 +323,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() @@ -332,7 +336,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() @@ -441,7 +445,7 @@ fn main() { let mut app = App::new("oauth2-v2") .author("Sebastian Thiel ") - .version("0.3.0+20150416") + .version("0.3.0+20150526") .about("Lets you access OAuth2 protocol related APIs.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_oauth2_v2_cli") .arg(Arg::with_name("url") diff --git a/gen/oauth2_v2/Cargo.toml b/gen/oauth2_v2/Cargo.toml index 1bc442c3db..e65fcb7145 100644 --- a/gen/oauth2_v2/Cargo.toml +++ b/gen/oauth2_v2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-oauth2_v2" -version = "0.1.8+20150416" +version = "0.1.8+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with oauth2 (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/oauth2_v2" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/oauth2_v2/README.md b/gen/oauth2_v2/README.md index 0ab92ba874..f252866f40 100644 --- a/gen/oauth2_v2/README.md +++ b/gen/oauth2_v2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-oauth2_v2` library allows access to all features of the *Google oauth2* service. -This documentation was generated from *oauth2* crate version *0.1.8+20150416*, where *20150416* is the exact revision of the *oauth2:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *oauth2* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *oauth2:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *oauth2* *v2* API can be found at the [official documentation site](https://developers.google.com/accounts/docs/OAuth2). diff --git a/gen/oauth2_v2/src/cmn.rs b/gen/oauth2_v2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/oauth2_v2/src/cmn.rs +++ b/gen/oauth2_v2/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/oauth2_v2/src/lib.rs b/gen/oauth2_v2/src/lib.rs index 25ef52533d..7e2a5e6f7e 100644 --- a/gen/oauth2_v2/src/lib.rs +++ b/gen/oauth2_v2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *oauth2* crate version *0.1.8+20150416*, where *20150416* is the exact revision of the *oauth2:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *oauth2* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *oauth2:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *oauth2* *v2* API can be found at the //! [official documentation site](https://developers.google.com/accounts/docs/OAuth2). diff --git a/gen/pagespeedonline2-cli/Cargo.toml b/gen/pagespeedonline2-cli/Cargo.toml index 1e9c741fdb..4149c8ed5b 100644 --- a/gen/pagespeedonline2-cli/Cargo.toml +++ b/gen/pagespeedonline2-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["pagespeedonline", "google", "cli"] name = "pagespeedonline2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/pagespeedonline2-cli/src/main.rs b/gen/pagespeedonline2-cli/src/main.rs index 85f2e19bb4..4449fb893c 100644 --- a/gen/pagespeedonline2-cli/src/main.rs +++ b/gen/pagespeedonline2-cli/src/main.rs @@ -102,6 +102,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -158,7 +159,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() @@ -171,7 +172,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() diff --git a/gen/pagespeedonline2/Cargo.toml b/gen/pagespeedonline2/Cargo.toml index 90957fde7a..e7aead602f 100644 --- a/gen/pagespeedonline2/Cargo.toml +++ b/gen/pagespeedonline2/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/pagespeedonline2/src/cmn.rs b/gen/pagespeedonline2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/pagespeedonline2/src/cmn.rs +++ b/gen/pagespeedonline2/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/plus1-cli/Cargo.toml b/gen/plus1-cli/Cargo.toml index 119f00f345..e4e50b2277 100644 --- a/gen/plus1-cli/Cargo.toml +++ b/gen/plus1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-plus1-cli" -version = "0.3.0+20150303" +version = "0.3.0+20150616" authors = ["Sebastian Thiel "] description = "A complete library to interact with plus (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/plus1-cli" @@ -17,8 +17,8 @@ keywords = ["plus", "google", "cli"] name = "plus1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/plus1-cli/README.md b/gen/plus1-cli/README.md index b321689706..4fe0fc5705 100644 --- a/gen/plus1-cli/README.md +++ b/gen/plus1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *plus* API at revision *20150303*. The CLI is at version *0.3.0*. +This documentation was generated from the *plus* API at revision *20150616*. The CLI is at version *0.3.0*. ```bash plus1 [options] diff --git a/gen/plus1-cli/mkdocs.yml b/gen/plus1-cli/mkdocs.yml index ff3afa930d..1fc7f644b2 100644 --- a/gen/plus1-cli/mkdocs.yml +++ b/gen/plus1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: plus v0.3.0+20150303 +site_name: plus v0.3.0+20150616 site_url: http://byron.github.io/google-apis-rs/google-plus1-cli site_description: Write integrating applications with bcore diff --git a/gen/plus1-cli/src/main.rs b/gen/plus1-cli/src/main.rs index b4b671c7c5..97c587e5aa 100644 --- a/gen/plus1-cli/src/main.rs +++ b/gen/plus1-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -147,6 +148,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -211,6 +213,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -262,6 +265,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -323,6 +327,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -534,6 +539,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -598,6 +604,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -693,6 +700,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -754,6 +762,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -812,6 +821,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -873,6 +883,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -986,7 +997,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() @@ -999,7 +1010,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() @@ -1344,7 +1355,7 @@ fn main() { let mut app = App::new("plus1") .author("Sebastian Thiel ") - .version("0.3.0+20150303") + .version("0.3.0+20150616") .about("The Google+ API enables developers to build on top of the Google+ platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_plus1_cli") .arg(Arg::with_name("url") diff --git a/gen/plus1/Cargo.toml b/gen/plus1/Cargo.toml index 2541e2127d..ea9941d4e3 100644 --- a/gen/plus1/Cargo.toml +++ b/gen/plus1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-plus1" -version = "0.1.8+20150303" +version = "0.1.8+20150616" authors = ["Sebastian Thiel "] description = "A complete library to interact with plus (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/plus1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/plus1/README.md b/gen/plus1/README.md index 1d05fe5471..d56d1d4512 100644 --- a/gen/plus1/README.md +++ b/gen/plus1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-plus1` library allows access to all features of the *Google plus* service. -This documentation was generated from *plus* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *plus* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *plus* *v1* API can be found at the [official documentation site](https://developers.google.com/+/api/). diff --git a/gen/plus1/src/cmn.rs b/gen/plus1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/plus1/src/cmn.rs +++ b/gen/plus1/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/plus1/src/lib.rs b/gen/plus1/src/lib.rs index 9ed3637ace..b357128869 100644 --- a/gen/plus1/src/lib.rs +++ b/gen/plus1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *plus* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *plus* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *plus* *v1* API can be found at the //! [official documentation site](https://developers.google.com/+/api/). diff --git a/gen/plusdomains1-cli/Cargo.toml b/gen/plusdomains1-cli/Cargo.toml index e71e93bdac..4b402aeaa1 100644 --- a/gen/plusdomains1-cli/Cargo.toml +++ b/gen/plusdomains1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-plusdomains1-cli" -version = "0.3.0+20150303" +version = "0.3.0+20150616" authors = ["Sebastian Thiel "] description = "A complete library to interact with plusDomains (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/plusdomains1-cli" @@ -17,8 +17,8 @@ keywords = ["plusDomains", "google", "cli"] name = "plusdomains1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/plusdomains1-cli/README.md b/gen/plusdomains1-cli/README.md index 60f30c2ed9..725b835f1a 100644 --- a/gen/plusdomains1-cli/README.md +++ b/gen/plusdomains1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *plusDomains* API at revision *20150303*. The CLI is at version *0.3.0*. +This documentation was generated from the *plusDomains* API at revision *20150616*. The CLI is at version *0.3.0*. ```bash plusdomains1 [options] diff --git a/gen/plusdomains1-cli/mkdocs.yml b/gen/plusdomains1-cli/mkdocs.yml index ce2d8dc35c..b4e12e21d3 100644 --- a/gen/plusdomains1-cli/mkdocs.yml +++ b/gen/plusdomains1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: plusDomains v0.3.0+20150303 +site_name: plusDomains v0.3.0+20150616 site_url: http://byron.github.io/google-apis-rs/google-plusdomains1-cli site_description: Write integrating applications with bcore diff --git a/gen/plusdomains1-cli/src/main.rs b/gen/plusdomains1-cli/src/main.rs index b70f14d2ca..e834e75cb4 100644 --- a/gen/plusdomains1-cli/src/main.rs +++ b/gen/plusdomains1-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -227,6 +228,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -285,6 +287,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -343,6 +346,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -401,6 +405,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -452,6 +457,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -542,6 +548,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -600,6 +607,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -690,6 +698,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -875,6 +884,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -926,6 +936,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1024,6 +1035,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1085,6 +1097,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1192,6 +1205,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1243,6 +1257,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1304,6 +1319,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1362,6 +1378,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1420,6 +1437,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1573,7 +1591,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() @@ -1586,7 +1604,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() @@ -2138,7 +2156,7 @@ fn main() { let mut app = App::new("plusdomains1") .author("Sebastian Thiel ") - .version("0.3.0+20150303") + .version("0.3.0+20150616") .about("The Google+ API enables developers to build on top of the Google+ platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_plusdomains1_cli") .arg(Arg::with_name("url") diff --git a/gen/plusdomains1/Cargo.toml b/gen/plusdomains1/Cargo.toml index 89b5f89434..ab0732029d 100644 --- a/gen/plusdomains1/Cargo.toml +++ b/gen/plusdomains1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-plusdomains1" -version = "0.1.8+20150303" +version = "0.1.8+20150616" authors = ["Sebastian Thiel "] description = "A complete library to interact with plusDomains (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/plusdomains1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/plusdomains1/README.md b/gen/plusdomains1/README.md index 1c5c9efb24..377ebee7d6 100644 --- a/gen/plusdomains1/README.md +++ b/gen/plusdomains1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-plusdomains1` library allows access to all features of the *Google plusDomains* service. -This documentation was generated from *plusDomains* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *plusDomains* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *plusDomains* *v1* API can be found at the [official documentation site](https://developers.google.com/+/domains/). diff --git a/gen/plusdomains1/src/cmn.rs b/gen/plusdomains1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/plusdomains1/src/cmn.rs +++ b/gen/plusdomains1/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/plusdomains1/src/lib.rs b/gen/plusdomains1/src/lib.rs index 9bdab0a27b..a238edbbfa 100644 --- a/gen/plusdomains1/src/lib.rs +++ b/gen/plusdomains1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *plusDomains* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *plusDomains* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *plusDomains* *v1* API can be found at the //! [official documentation site](https://developers.google.com/+/domains/). diff --git a/gen/prediction1d6-cli/Cargo.toml b/gen/prediction1d6-cli/Cargo.toml index 750fc546d7..cf316aa85c 100644 --- a/gen/prediction1d6-cli/Cargo.toml +++ b/gen/prediction1d6-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["prediction", "google", "cli"] name = "prediction1d6" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/prediction1d6-cli/src/main.rs b/gen/prediction1d6-cli/src/main.rs index 9d2d3b84c0..1194e11528 100644 --- a/gen/prediction1d6-cli/src/main.rs +++ b/gen/prediction1d6-cli/src/main.rs @@ -121,6 +121,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -172,6 +173,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -267,6 +269,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -356,6 +359,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -414,6 +418,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -497,6 +502,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -581,6 +587,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -666,7 +673,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() @@ -679,7 +686,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() diff --git a/gen/prediction1d6/Cargo.toml b/gen/prediction1d6/Cargo.toml index 5660f190ec..456120485b 100644 --- a/gen/prediction1d6/Cargo.toml +++ b/gen/prediction1d6/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/prediction1d6/src/cmn.rs b/gen/prediction1d6/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/prediction1d6/src/cmn.rs +++ b/gen/prediction1d6/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/pubsub1_beta2-cli/Cargo.toml b/gen/pubsub1_beta2-cli/Cargo.toml index 5bd94c6548..a1bd5131a9 100644 --- a/gen/pubsub1_beta2-cli/Cargo.toml +++ b/gen/pubsub1_beta2-cli/Cargo.toml @@ -4,10 +4,11 @@ [package] name = "google-pubsub1_beta2-cli" -version = "0.3.0+20150326" +version = "0.3.0+20150427" authors = ["Sebastian Thiel "] description = "A complete library to interact with pubsub (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1_beta2-cli" +homepage = "https://cloud.google.com/pubsub/docs" documentation = "http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli" license = "MIT" keywords = ["pubsub", "google", "cli"] @@ -16,8 +17,8 @@ keywords = ["pubsub", "google", "cli"] name = "pubsub1-beta2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/pubsub1_beta2-cli/README.md b/gen/pubsub1_beta2-cli/README.md index c814965140..af8d5b63fc 100644 --- a/gen/pubsub1_beta2-cli/README.md +++ b/gen/pubsub1_beta2-cli/README.md @@ -10,6 +10,9 @@ capabilities. Errors will be printed to standard error, and cause the program's If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. +Everything else about the *pubsub* API can be found at the +[official documentation site](https://cloud.google.com/pubsub/docs). + # Downloads You can download the pre-compiled 64bit binaries for the following platforms: @@ -21,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *pubsub* API at revision *20150326*. The CLI is at version *0.3.0*. +This documentation was generated from the *pubsub* API at revision *20150427*. The CLI is at version *0.3.0*. ```bash pubsub1-beta2 [options] @@ -30,16 +33,22 @@ pubsub1-beta2 [options] subscriptions-create (-r )... [-p ]... [-o ] subscriptions-delete [-p ]... [-o ] subscriptions-get [-p ]... [-o ] + subscriptions-get-iam-policy [-p ]... [-o ] subscriptions-list [-p ]... [-o ] subscriptions-modify-ack-deadline (-r )... [-p ]... [-o ] subscriptions-modify-push-config (-r )... [-p ]... [-o ] subscriptions-pull (-r )... [-p ]... [-o ] + subscriptions-set-iam-policy (-r )... [-p ]... [-o ] + subscriptions-test-iam-permissions (-r )... [-p ]... [-o ] topics-create (-r )... [-p ]... [-o ] topics-delete [-p ]... [-o ] topics-get [-p ]... [-o ] + topics-get-iam-policy [-p ]... [-o ] topics-list [-p ]... [-o ] topics-publish (-r )... [-p ]... [-o ] + topics-set-iam-policy (-r )... [-p ]... [-o ] topics-subscriptions-list [-p ]... [-o ] + topics-test-iam-permissions (-r )... [-p ]... [-o ] pubsub1-beta2 --help Configuration: diff --git a/gen/pubsub1_beta2-cli/mkdocs.yml b/gen/pubsub1_beta2-cli/mkdocs.yml index 5d377e7f3f..b64bb13fb1 100644 --- a/gen/pubsub1_beta2-cli/mkdocs.yml +++ b/gen/pubsub1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: pubsub v0.3.0+20150326 +site_name: pubsub v0.3.0+20150427 site_url: http://byron.github.io/google-apis-rs/google-pubsub1_beta2-cli site_description: Write integrating applications with bcore @@ -13,16 +13,22 @@ pages: - ['projects_subscriptions-create.md', 'Projects', 'Subscriptions Create'] - ['projects_subscriptions-delete.md', 'Projects', 'Subscriptions Delete'] - ['projects_subscriptions-get.md', 'Projects', 'Subscriptions Get'] +- ['projects_subscriptions-get-iam-policy.md', 'Projects', 'Subscriptions Get Iam Policy'] - ['projects_subscriptions-list.md', 'Projects', 'Subscriptions List'] - ['projects_subscriptions-modify-ack-deadline.md', 'Projects', 'Subscriptions Modify Ack Deadline'] - ['projects_subscriptions-modify-push-config.md', 'Projects', 'Subscriptions Modify Push Config'] - ['projects_subscriptions-pull.md', 'Projects', 'Subscriptions Pull'] +- ['projects_subscriptions-set-iam-policy.md', 'Projects', 'Subscriptions Set Iam Policy'] +- ['projects_subscriptions-test-iam-permissions.md', 'Projects', 'Subscriptions Test Iam Permissions'] - ['projects_topics-create.md', 'Projects', 'Topics Create'] - ['projects_topics-delete.md', 'Projects', 'Topics Delete'] - ['projects_topics-get.md', 'Projects', 'Topics Get'] +- ['projects_topics-get-iam-policy.md', 'Projects', 'Topics Get Iam Policy'] - ['projects_topics-list.md', 'Projects', 'Topics List'] - ['projects_topics-publish.md', 'Projects', 'Topics Publish'] +- ['projects_topics-set-iam-policy.md', 'Projects', 'Topics Set Iam Policy'] - ['projects_topics-subscriptions-list.md', 'Projects', 'Topics Subscriptions List'] +- ['projects_topics-test-iam-permissions.md', 'Projects', 'Topics Test Iam Permissions'] theme: readthedocs diff --git a/gen/pubsub1_beta2-cli/src/main.rs b/gen/pubsub1_beta2-cli/src/main.rs index 176b5fbdfa..10d8939917 100644 --- a/gen/pubsub1_beta2-cli/src/main.rs +++ b/gen/pubsub1_beta2-cli/src/main.rs @@ -122,6 +122,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -151,8 +152,8 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "ack-deadline-seconds" => Some(("ackDeadlineSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "topic" => Some(("topic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ack-deadline-seconds" => Some(("ackDeadlineSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "push-config.attributes" => Some(("pushConfig.attributes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "push-config.push-endpoint" => Some(("pushConfig.pushEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -210,6 +211,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -261,6 +263,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -312,6 +315,59 @@ impl<'n, 'a> Engine<'n, 'a> { 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 _projects_subscriptions_get_iam_policy(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().subscriptions_get_iam_policy(opt.value_of("resource").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(()) } } @@ -370,6 +426,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -401,8 +458,9 @@ impl<'n, 'a> Engine<'n, 'a> { match &temp_cursor.to_string()[..] { "ack-deadline-seconds" => Some(("ackDeadlineSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "ack-id" => Some(("ackId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ack-ids" => Some(("ackIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["ack-deadline-seconds", "ack-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["ack-deadline-seconds", "ack-id", "ack-ids"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -455,6 +513,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -540,6 +599,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -625,6 +685,178 @@ impl<'n, 'a> Engine<'n, 'a> { 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 _projects_subscriptions_set_iam_policy(&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()[..] { + "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "version"]); + 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::SetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().subscriptions_set_iam_policy(request, opt.value_of("resource").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 _projects_subscriptions_test_iam_permissions(&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()[..] { + "permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["permissions"]); + 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::TestIamPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().subscriptions_test_iam_permissions(request, opt.value_of("resource").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(()) } } @@ -709,6 +941,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -760,6 +993,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -811,6 +1045,59 @@ impl<'n, 'a> Engine<'n, 'a> { 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 _projects_topics_get_iam_policy(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().topics_get_iam_policy(opt.value_of("resource").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(()) } } @@ -869,6 +1156,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -952,6 +1240,93 @@ impl<'n, 'a> Engine<'n, 'a> { 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 _projects_topics_set_iam_policy(&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()[..] { + "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "version"]); + 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::SetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().topics_set_iam_policy(request, opt.value_of("resource").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(()) } } @@ -1010,6 +1385,92 @@ impl<'n, 'a> Engine<'n, 'a> { 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 _projects_topics_test_iam_permissions(&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()[..] { + "permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["permissions"]); + 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::TestIamPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().topics_test_iam_permissions(request, opt.value_of("resource").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(()) } } @@ -1035,6 +1496,9 @@ impl<'n, 'a> Engine<'n, 'a> { ("subscriptions-get", Some(opt)) => { call_result = self._projects_subscriptions_get(opt, dry_run, &mut err); }, + ("subscriptions-get-iam-policy", Some(opt)) => { + call_result = self._projects_subscriptions_get_iam_policy(opt, dry_run, &mut err); + }, ("subscriptions-list", Some(opt)) => { call_result = self._projects_subscriptions_list(opt, dry_run, &mut err); }, @@ -1047,6 +1511,12 @@ impl<'n, 'a> Engine<'n, 'a> { ("subscriptions-pull", Some(opt)) => { call_result = self._projects_subscriptions_pull(opt, dry_run, &mut err); }, + ("subscriptions-set-iam-policy", Some(opt)) => { + call_result = self._projects_subscriptions_set_iam_policy(opt, dry_run, &mut err); + }, + ("subscriptions-test-iam-permissions", Some(opt)) => { + call_result = self._projects_subscriptions_test_iam_permissions(opt, dry_run, &mut err); + }, ("topics-create", Some(opt)) => { call_result = self._projects_topics_create(opt, dry_run, &mut err); }, @@ -1056,15 +1526,24 @@ impl<'n, 'a> Engine<'n, 'a> { ("topics-get", Some(opt)) => { call_result = self._projects_topics_get(opt, dry_run, &mut err); }, + ("topics-get-iam-policy", Some(opt)) => { + call_result = self._projects_topics_get_iam_policy(opt, dry_run, &mut err); + }, ("topics-list", Some(opt)) => { call_result = self._projects_topics_list(opt, dry_run, &mut err); }, ("topics-publish", Some(opt)) => { call_result = self._projects_topics_publish(opt, dry_run, &mut err); }, + ("topics-set-iam-policy", Some(opt)) => { + call_result = self._projects_topics_set_iam_policy(opt, dry_run, &mut err); + }, ("topics-subscriptions-list", Some(opt)) => { call_result = self._projects_topics_subscriptions_list(opt, dry_run, &mut err); }, + ("topics-test-iam-permissions", Some(opt)) => { + call_result = self._projects_topics_test_iam_permissions(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("projects".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -1105,7 +1584,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() @@ -1118,7 +1597,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() @@ -1126,12 +1605,16 @@ impl<'n, 'a> Engine<'n, 'a> { let engine = Engine { opt: opt, hub: api::Pubsub::new(client, auth), - gp: vec!["alt", "fields", "key", "oauth-token", "pretty-print", "quota-user", "user-ip"], + gp: vec!["$-xgafv", "access-token", "alt", "bearer-token", "callback", "fields", "key", "oauth-token", "pp", "pretty-print", "quota-user", "upload-type", "upload-protocol"], gpm: vec![ + ("$-xgafv", "$.xgafv"), + ("access-token", "access_token"), + ("bearer-token", "bearer_token"), ("oauth-token", "oauth_token"), ("pretty-print", "prettyPrint"), ("quota-user", "quotaUser"), - ("user-ip", "userIp"), + ("upload-type", "uploadType"), + ("upload-protocol", "upload_protocol"), ] }; @@ -1153,14 +1636,14 @@ impl<'n, 'a> Engine<'n, 'a> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'subscriptions-acknowledge', 'subscriptions-create', 'subscriptions-delete', 'subscriptions-get', 'subscriptions-list', 'subscriptions-modify-ack-deadline', 'subscriptions-modify-push-config', 'subscriptions-pull', 'topics-create', 'topics-delete', 'topics-get', 'topics-list', 'topics-publish' and 'topics-subscriptions-list'", vec![ + ("projects", "methods: 'subscriptions-acknowledge', 'subscriptions-create', 'subscriptions-delete', 'subscriptions-get', 'subscriptions-get-iam-policy', 'subscriptions-list', 'subscriptions-modify-ack-deadline', 'subscriptions-modify-push-config', 'subscriptions-pull', 'subscriptions-set-iam-policy', 'subscriptions-test-iam-permissions', 'topics-create', 'topics-delete', 'topics-get', 'topics-get-iam-policy', 'topics-list', 'topics-publish', 'topics-set-iam-policy', 'topics-subscriptions-list' and 'topics-test-iam-permissions'", vec![ ("subscriptions-acknowledge", Some(r##"Acknowledges the messages associated with the ack tokens in the AcknowledgeRequest. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error."##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_subscriptions-acknowledge", vec![ (Some(r##"subscription"##), None, - None, + Some(r##"The subscription whose message is being acknowledged."##), Some(true), Some(false)), @@ -1188,7 +1671,7 @@ fn main() { vec![ (Some(r##"name"##), None, - None, + Some(r##"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"."##), Some(true), Some(false)), @@ -1216,7 +1699,7 @@ fn main() { vec![ (Some(r##"subscription"##), None, - None, + Some(r##"The subscription to delete."##), Some(true), Some(false)), @@ -1238,7 +1721,29 @@ fn main() { vec![ (Some(r##"subscription"##), None, + Some(r##"The name of the subscription to get."##), + 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)), + ]), + ("subscriptions-get-iam-policy", + Some(r##"Gets the access control policy for a resource. May be empty if no such policy or resource exists."##), + "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_subscriptions-get-iam-policy", + vec![ + (Some(r##"resource"##), None, + Some(r##"REQUIRED: The resource for which policy is being requested. Usually some path like projects/{project}."##), Some(true), Some(false)), @@ -1260,7 +1765,7 @@ fn main() { vec![ (Some(r##"project"##), None, - None, + Some(r##"The name of the cloud project that subscriptions belong to."##), Some(true), Some(false)), @@ -1282,7 +1787,7 @@ fn main() { vec![ (Some(r##"subscription"##), None, - None, + Some(r##"The name of the subscription."##), Some(true), Some(false)), @@ -1310,7 +1815,7 @@ fn main() { vec![ (Some(r##"subscription"##), None, - None, + Some(r##"The name of the subscription."##), Some(true), Some(false)), @@ -1338,7 +1843,63 @@ fn main() { vec![ (Some(r##"subscription"##), None, + Some(r##"The subscription from which messages should be pulled."##), + 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)), + ]), + ("subscriptions-set-iam-policy", + Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy."##), + "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_subscriptions-set-iam-policy", + vec![ + (Some(r##"resource"##), None, + Some(r##"REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}."##), + 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)), + ]), + ("subscriptions-test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified resource."##), + "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_subscriptions-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}."##), Some(true), Some(false)), @@ -1366,7 +1927,7 @@ fn main() { vec![ (Some(r##"name"##), None, - None, + Some(r##"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"."##), Some(true), Some(false)), @@ -1394,7 +1955,7 @@ fn main() { vec![ (Some(r##"topic"##), None, - None, + Some(r##"Name of the topic to delete."##), Some(true), Some(false)), @@ -1416,7 +1977,29 @@ fn main() { vec![ (Some(r##"topic"##), None, + Some(r##"The name of the topic to get."##), + 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)), + ]), + ("topics-get-iam-policy", + Some(r##"Gets the access control policy for a resource. May be empty if no such policy or resource exists."##), + "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_topics-get-iam-policy", + vec![ + (Some(r##"resource"##), None, + Some(r##"REQUIRED: The resource for which policy is being requested. Usually some path like projects/{project}."##), Some(true), Some(false)), @@ -1438,7 +2021,7 @@ fn main() { vec![ (Some(r##"project"##), None, - None, + Some(r##"The name of the cloud project that topics belong to."##), Some(true), Some(false)), @@ -1460,7 +2043,35 @@ fn main() { vec![ (Some(r##"topic"##), None, + Some(r##"The messages in the request will be published on this topic."##), + 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)), + ]), + ("topics-set-iam-policy", + Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy."##), + "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_topics-set-iam-policy", + vec![ + (Some(r##"resource"##), None, + Some(r##"REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}."##), Some(true), Some(false)), @@ -1488,7 +2099,7 @@ fn main() { vec![ (Some(r##"topic"##), None, - None, + Some(r##"The name of the topic that subscriptions are attached to."##), Some(true), Some(false)), @@ -1498,6 +2109,34 @@ fn main() { 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)), + ]), + ("topics-test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified resource."##), + "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_topics-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}."##), + 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"##), @@ -1510,7 +2149,7 @@ fn main() { let mut app = App::new("pubsub1-beta2") .author("Sebastian Thiel ") - .version("0.3.0+20150326") + .version("0.3.0+20150427") .about("Provides reliable, many-to-many, asynchronous messaging between applications.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/pubsub1_beta2/Cargo.toml b/gen/pubsub1_beta2/Cargo.toml index 9ae3a49e5f..decd4260d3 100644 --- a/gen/pubsub1_beta2/Cargo.toml +++ b/gen/pubsub1_beta2/Cargo.toml @@ -4,10 +4,11 @@ [package] name = "google-pubsub1_beta2" -version = "0.1.8+20150326" +version = "0.1.8+20150427" authors = ["Sebastian Thiel "] description = "A complete library to interact with pubsub (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1_beta2" +homepage = "https://cloud.google.com/pubsub/docs" documentation = "http://byron.github.io/google-apis-rs/google_pubsub1_beta2" license = "MIT" keywords = ["pubsub", "google", "protocol", "web", "api"] @@ -15,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/pubsub1_beta2/README.md b/gen/pubsub1_beta2/README.md index e78540a5fe..8ad83b0ef1 100644 --- a/gen/pubsub1_beta2/README.md +++ b/gen/pubsub1_beta2/README.md @@ -5,13 +5,16 @@ DO NOT EDIT ! --> The `google-pubsub1_beta2` library allows access to all features of the *Google pubsub* service. -This documentation was generated from *pubsub* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *pubsub* crate version *0.1.8+20150427*, where *20150427* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. + +Everything else about the *pubsub* *v1_beta2* API can be found at the +[official documentation site](https://cloud.google.com/pubsub/docs). # Features Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.Pubsub.html) ... * projects - * [*subscriptions acknowledge*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionGetCall.html), [*subscriptions list*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionPullCall.html), [*topics create*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicCreateCall.html), [*topics delete*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicDeleteCall.html), [*topics get*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicGetCall.html), [*topics list*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicListCall.html), [*topics publish*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicPublishCall.html) and [*topics subscriptions list*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicSubscriptionListCall.html) + * [*subscriptions acknowledge*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicCreateCall.html), [*topics delete*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicDeleteCall.html), [*topics get*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicGetCall.html), [*topics get iam policy*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicListCall.html), [*topics publish*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](http://byron.github.io/google-apis-rs/google_pubsub1_beta2/struct.ProjectTopicTestIamPermissionCall.html) diff --git a/gen/pubsub1_beta2/src/cmn.rs b/gen/pubsub1_beta2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/pubsub1_beta2/src/cmn.rs +++ b/gen/pubsub1_beta2/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/pubsub1_beta2/src/lib.rs b/gen/pubsub1_beta2/src/lib.rs index 3713275e77..2debc69f5d 100644 --- a/gen/pubsub1_beta2/src/lib.rs +++ b/gen/pubsub1_beta2/src/lib.rs @@ -2,14 +2,17 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *pubsub* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *pubsub* crate version *0.1.8+20150427*, where *20150427* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! +//! Everything else about the *pubsub* *v1_beta2* API can be found at the +//! [official documentation site](https://cloud.google.com/pubsub/docs). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1_beta2). //! # Features //! //! Handle the following *Resources* with ease from the central [hub](struct.Pubsub.html) ... //! //! * projects -//! * [*subscriptions acknowledge*](struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](struct.ProjectSubscriptionGetCall.html), [*subscriptions list*](struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](struct.ProjectSubscriptionPullCall.html), [*topics create*](struct.ProjectTopicCreateCall.html), [*topics delete*](struct.ProjectTopicDeleteCall.html), [*topics get*](struct.ProjectTopicGetCall.html), [*topics list*](struct.ProjectTopicListCall.html), [*topics publish*](struct.ProjectTopicPublishCall.html) and [*topics subscriptions list*](struct.ProjectTopicSubscriptionListCall.html) +//! * [*subscriptions acknowledge*](struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](struct.ProjectTopicCreateCall.html), [*topics delete*](struct.ProjectTopicDeleteCall.html), [*topics get*](struct.ProjectTopicGetCall.html), [*topics get iam policy*](struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](struct.ProjectTopicListCall.html), [*topics publish*](struct.ProjectTopicPublishCall.html), [*topics set iam policy*](struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](struct.ProjectTopicTestIamPermissionCall.html) //! //! //! diff --git a/gen/pubsub1_beta2/src/lib.rs.in b/gen/pubsub1_beta2/src/lib.rs.in index 8d1bfc4cd7..0d2674e113 100644 --- a/gen/pubsub1_beta2/src/lib.rs.in +++ b/gen/pubsub1_beta2/src/lib.rs.in @@ -158,7 +158,26 @@ impl<'a, C, A> Pubsub // ############ // SCHEMAS ### // ########## -/// There is no detailed description. +/// Request message for `TestIamPermissions` method. +/// +/// # 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*). +/// +/// * [subscriptions test iam permissions projects](struct.ProjectSubscriptionTestIamPermissionCall.html) (request) +/// * [topics test iam permissions projects](struct.ProjectTopicTestIamPermissionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestIamPermissionsRequest { + /// The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. + pub permissions: Option>, +} + +impl RequestValue for TestIamPermissionsRequest {} + + +/// Response for the ListTopicSubscriptions method. /// /// # Activities /// @@ -169,33 +188,52 @@ impl<'a, C, A> Pubsub /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListTopicSubscriptionsResponse { - /// no description provided + /// If not empty, indicates that there may be more subscriptions that match the request; this value should be passed in a new ListTopicSubscriptionsRequest to get more subscriptions. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// no description provided + /// The names of the subscriptions that match the request. pub subscriptions: Option>, } impl ResponseResult for ListTopicSubscriptionsResponse {} -/// There is no detailed description. +/// Request message for `SetIamPolicy` method. +/// +/// # 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*). +/// +/// * [subscriptions set iam policy projects](struct.ProjectSubscriptionSetIamPolicyCall.html) (request) +/// * [topics set iam policy projects](struct.ProjectTopicSetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetIamPolicyRequest { + /// REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + pub policy: Option, +} + +impl RequestValue for SetIamPolicyRequest {} + + +/// A message and its corresponding acknowledgment ID. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ReceivedMessage { - /// no description provided + /// This ID can be used to acknowledge the received message. #[serde(rename="ackId")] pub ack_id: Option, - /// no description provided + /// The message. pub message: Option, } impl Part for ReceivedMessage {} -/// There is no detailed description. +/// Request for the Acknowledge method. /// /// # Activities /// @@ -206,7 +244,7 @@ impl Part for ReceivedMessage {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AcknowledgeRequest { - /// no description provided + /// The acknowledgment ID for the messages being acknowledged that was returned by the Pub/Sub system in the Pull response. Must not be empty. #[serde(rename="ackIds")] pub ack_ids: Option>, } @@ -214,7 +252,35 @@ pub struct AcknowledgeRequest { impl RequestValue for AcknowledgeRequest {} -/// There is no detailed description. +/// A rule to be applied in a Policy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Rule { + /// The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is not in this set of entries. The formation for in and not_in entries is the same as members in a Binding above. + #[serde(rename="notIn")] + pub not_in: Option>, + /// Human-readable description of the rule. + pub description: Option, + /// The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in this set of entries. + #[serde(rename="in")] + pub in_: Option>, + /// Required + pub action: Option, + /// Additional restrictions that must be met + pub conditions: Option>, + /// The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action. + #[serde(rename="logConfig")] + pub log_config: Option>, + /// A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs. + pub permissions: Option>, +} + +impl Part for Rule {} + + +/// Request for the ModifyAckDeadline method. /// /// # Activities /// @@ -225,18 +291,21 @@ impl RequestValue for AcknowledgeRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ModifyAckDeadlineRequest { - /// no description provided + /// The new ack deadline with respect to the time this request was sent to the Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack deadline will expire 10 seconds after the ModifyAckDeadline call was made. Specifying zero may immediately make the message available for another pull request. #[serde(rename="ackDeadlineSeconds")] pub ack_deadline_seconds: Option, - /// no description provided + /// The acknowledgment ID. #[serde(rename="ackId")] pub ack_id: Option, + /// List of acknowledgment IDs. + #[serde(rename="ackIds")] + pub ack_ids: Option>, } impl RequestValue for ModifyAckDeadlineRequest {} -/// There is no detailed description. +/// Request for the Publish method. /// /// # Activities /// @@ -247,14 +316,57 @@ impl RequestValue for ModifyAckDeadlineRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PublishRequest { - /// no description provided + /// The messages to publish. pub messages: Option>, } impl RequestValue for PublishRequest {} -/// There is no detailed description. +/// Configuration for a push delivery endpoint. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PushConfig { + /// Endpoint configuration attributes. Every endpoint has a set of API supported attributes that can be used to control different aspects of the message delivery. The currently supported attribute is `x-goog-version`, which you can use to change the format of the push message. This attribute indicates the version of the data expected by the endpoint. This controls the shape of the envelope (i.e. its fields and metadata). The endpoint version is based on the version of the Pub/Sub API. If not present during the CreateSubscription call, it will default to the version of the API used to make such call. If not present during a ModifyPushConfig call, its value will not be changed. GetSubscription calls will always return a valid version, even if the subscription was created without this attribute. The possible values for this attribute are: * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + pub attributes: Option>, + /// A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push". + #[serde(rename="pushEndpoint")] + pub push_endpoint: Option, +} + +impl Part for PushConfig {} + + +/// # 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"] } ] } ``` +/// +/// # 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*). +/// +/// * [subscriptions get iam policy projects](struct.ProjectSubscriptionGetIamPolicyCall.html) (response) +/// * [topics get iam policy projects](struct.ProjectTopicGetIamPolicyCall.html) (response) +/// * [subscriptions set iam policy projects](struct.ProjectSubscriptionSetIamPolicyCall.html) (response) +/// * [topics set iam policy projects](struct.ProjectTopicSetIamPolicyCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// no description provided + pub rules: Option>, + /// It is an error to specify multiple bindings for the same role. It is an error to specify a binding with no members. + pub bindings: Option>, + /// The policy language version. The version of the policy itself is represented by the etag. The current version is 0. + pub version: Option, + /// Can be used to perform a read-modify-write. + pub etag: Option, +} + +impl ResponseResult for Policy {} + + +/// Response for the ListSubscriptions method. /// /// # Activities /// @@ -265,17 +377,17 @@ impl RequestValue for PublishRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListSubscriptionsResponse { - /// no description provided + /// If not empty, indicates that there may be more subscriptions that match the request; this value should be passed in a new ListSubscriptionsRequest to get more subscriptions. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// no description provided + /// The subscriptions that match the request. pub subscriptions: Option>, } impl ResponseResult for ListSubscriptionsResponse {} -/// There is no detailed description. +/// Response for the ListTopics method. /// /// # Activities /// @@ -286,17 +398,17 @@ impl ResponseResult for ListSubscriptionsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListTopicsResponse { - /// no description provided + /// If not empty, indicates that there may be more topics that match the request; this value should be passed in a new ListTopicsRequest. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// no description provided + /// The resulting topics. pub topics: Option>, } impl ResponseResult for ListTopicsResponse {} -/// There is no detailed description. +/// Request for the ModifyPushConfig method. /// /// # Activities /// @@ -307,7 +419,7 @@ impl ResponseResult for ListTopicsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ModifyPushConfigRequest { - /// no description provided + /// The push configuration for future deliveries. An empty pushConfig indicates that the Pub/Sub system should stop pushing messages from the given subscription and allow messages to be pulled and acknowledged - effectively pausing the subscription if Pull is not called. #[serde(rename="pushConfig")] pub push_config: Option, } @@ -315,7 +427,7 @@ pub struct ModifyPushConfigRequest { impl RequestValue for ModifyPushConfigRequest {} -/// There is no detailed 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); } /// /// # Activities /// @@ -334,7 +446,51 @@ pub struct Empty; impl ResponseResult for Empty {} -/// There is no detailed description. +/// Write a Cloud Audit log +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CloudAuditOptions; + +impl Part for CloudAuditOptions {} + + +/// Options for counters +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CounterOptions { + /// The field value to attribute. + pub field: Option, + /// The metric to update. + pub metric: Option, +} + +impl Part for CounterOptions {} + + +/// Response message for `TestIamPermissions` method. +/// +/// # 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*). +/// +/// * [subscriptions test iam permissions projects](struct.ProjectSubscriptionTestIamPermissionCall.html) (response) +/// * [topics test iam permissions projects](struct.ProjectTopicTestIamPermissionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestIamPermissionsResponse { + /// A subset of `TestPermissionsRequest.permissions` that the caller is allowed. + pub permissions: Option>, +} + +impl ResponseResult for TestIamPermissionsResponse {} + + +/// Request for the Pull method. /// /// # Activities /// @@ -345,10 +501,10 @@ impl ResponseResult for Empty {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PullRequest { - /// no description provided + /// If this is specified as true the system will respond immediately even if it is not able to return a message in the Pull response. Otherwise the system is allowed to wait until at least one message is available rather than returning no messages. The client may cancel the request if it does not wish to wait any longer for the response. #[serde(rename="returnImmediately")] pub return_immediately: Option, - /// no description provided + /// The maximum number of messages returned for this request. The Pub/Sub system may return fewer than the number specified. #[serde(rename="maxMessages")] pub max_messages: Option, } @@ -356,23 +512,32 @@ pub struct PullRequest { impl RequestValue for PullRequest {} -/// There is no detailed description. +/// Associates members of various types with roles. See below for details of the various objects that can be included as members. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PushConfig { - /// no description provided - pub attributes: Option>, - /// no description provided - #[serde(rename="pushEndpoint")] - pub push_endpoint: Option, +pub struct Binding { + /// The name of the role to which the members should be bound. Examples: "roles/viewer", "roles/editor", "roles/owner". Required + pub role: Option, + /// Format of member entries: 1. allUsers Matches any requesting principal (users, service accounts or anonymous). 2. allAuthenticatedUsers Matches any requesting authenticated principal (users or service accounts). 3. user:{emailid} A google user account using an email address. For example alice@gmail.com, joe@example.com 4. serviceAccount:{emailid} An service account email. 5. group:{emailid} A google group with an email address. For example auth-ti-cloud@google.com 6. domain:{domain} A Google Apps domain name. For example google.com, example.com + pub members: Option>, } -impl Part for PushConfig {} +impl Part for Binding {} -/// There is no detailed description. +/// Write a Data Access (Gin) log +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DataAccessOptions; + +impl Part for DataAccessOptions {} + + +/// A topic resource. /// /// # Activities /// @@ -384,7 +549,7 @@ impl Part for PushConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Topic { - /// no description provided + /// 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". pub name: Option, } @@ -392,7 +557,7 @@ impl RequestValue for Topic {} impl ResponseResult for Topic {} -/// There is no detailed description. +/// Response for the Publish method. /// /// # Activities /// @@ -403,7 +568,7 @@ impl ResponseResult for Topic {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PublishResponse { - /// no description provided + /// The server-assigned ID of each published message, in the same order as the messages in the request. IDs are guaranteed to be unique within the topic. #[serde(rename="messageIds")] pub message_ids: Option>, } @@ -411,7 +576,7 @@ pub struct PublishResponse { impl ResponseResult for PublishResponse {} -/// There is no detailed description. +/// Response for the Pull method. /// /// # Activities /// @@ -422,7 +587,7 @@ impl ResponseResult for PublishResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PullResponse { - /// no description provided + /// Received Pub/Sub messages. The Pub/Sub system will return zero messages if there are no more available in the backlog. The Pub/Sub system may return fewer than the maxMessages requested even if there are more messages available in the backlog. #[serde(rename="receivedMessages")] pub received_messages: Option>, } @@ -430,17 +595,17 @@ pub struct PullResponse { impl ResponseResult for PullResponse {} -/// There is no detailed description. +/// A message data and its attributes. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PubsubMessage { - /// no description provided + /// Optional attributes for this message. pub attributes: Option>, - /// no description provided + /// The message payload. For JSON requests, the value of this field must be base64-encoded. pub data: Option, - /// no description provided + /// ID of this message assigned by the server at publication time. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a PubsubMessage via a Pull call or a push delivery. It must not be populated by a publisher in a Publish call. #[serde(rename="messageId")] pub message_id: Option, } @@ -448,7 +613,49 @@ pub struct PubsubMessage { impl Part for PubsubMessage {} -/// There is no detailed description. +/// Specifies what kind of log the caller must write Increment a streamz counter with the specified metric and field names. Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended. Field names correspond to IAM request parameters and field values are their respective values. At present only "iam_principal", corresponding to IAMContext.principal, is supported. Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==> increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]} At this time we do not support: * multiple field names (though this may be supported in the future) * decrementing the counter * incrementing it by anything other than 1 +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogConfig { + /// Counter options. + pub counter: Option, + /// Data access options. + #[serde(rename="dataAccess")] + pub data_access: Option, + /// Cloud audit options. + #[serde(rename="cloudAudit")] + pub cloud_audit: Option, +} + +impl Part for LogConfig {} + + +/// A condition to be met. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Condition { + /// Trusted attributes supplied by the IAM system. + pub iam: Option, + /// Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. + pub sys: Option, + /// The objects of the condition. This is mutually exclusive with 'value'. + pub values: Option>, + /// Trusted attributes discharged by the service. + pub svc: Option, + /// The object of the condition. Exactly one of these must be set. + pub value: Option, + /// An operator to apply the subject with. + pub op: Option, +} + +impl Part for Condition {} + + +/// A subscription resource. /// /// # Activities /// @@ -460,15 +667,15 @@ impl Part for PubsubMessage {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Subscription { - /// no description provided + /// 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. + pub topic: Option, + /// This value is the maximum time after a subscriber receives a message before the subscriber should acknowledge the message. After message delivery but before the ack deadline expires and before the message is acknowledged, it is an outstanding message and will not be delivered again during that time (on a best-effort basis). For pull delivery this value is used as the initial value for the ack deadline. It may be overridden for each message using its corresponding ack_id by calling ModifyAckDeadline. For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. If this parameter is not set, the default value of 60 seconds is used. #[serde(rename="ackDeadlineSeconds")] pub ack_deadline_seconds: Option, - /// no description provided - pub topic: Option, - /// no description provided + /// If push delivery is used with this subscription, this field is used to configure it. An empty pushConfig signifies that the subscriber will pull and ack messages using API methods. #[serde(rename="pushConfig")] pub push_config: Option, - /// no description provided + /// 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". pub name: Option, } @@ -504,7 +711,7 @@ impl ResponseResult for Subscription {} /// ::default(), None); /// let mut hub = Pubsub::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `subscriptions_acknowledge(...)`, `subscriptions_create(...)`, `subscriptions_delete(...)`, `subscriptions_get(...)`, `subscriptions_list(...)`, `subscriptions_modify_ack_deadline(...)`, `subscriptions_modify_push_config(...)`, `subscriptions_pull(...)`, `topics_create(...)`, `topics_delete(...)`, `topics_get(...)`, `topics_list(...)`, `topics_publish(...)` and `topics_subscriptions_list(...)` +/// // like `subscriptions_acknowledge(...)`, `subscriptions_create(...)`, `subscriptions_delete(...)`, `subscriptions_get(...)`, `subscriptions_get_iam_policy(...)`, `subscriptions_list(...)`, `subscriptions_modify_ack_deadline(...)`, `subscriptions_modify_push_config(...)`, `subscriptions_pull(...)`, `subscriptions_set_iam_policy(...)`, `subscriptions_test_iam_permissions(...)`, `topics_create(...)`, `topics_delete(...)`, `topics_get(...)`, `topics_get_iam_policy(...)`, `topics_list(...)`, `topics_publish(...)`, `topics_set_iam_policy(...)`, `topics_subscriptions_list(...)` and `topics_test_iam_permissions(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -525,7 +732,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `project` - No description provided. + /// * `project` - The name of the cloud project that topics belong to. pub fn topics_list(&self, project: &str) -> ProjectTopicListCall<'a, C, A> { ProjectTopicListCall { hub: self.hub, @@ -545,7 +752,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `subscription` - No description provided. + /// * `subscription` - The subscription from which messages should be pulled. pub fn subscriptions_pull(&self, request: PullRequest, subscription: &str) -> ProjectSubscriptionPullCall<'a, C, A> { ProjectSubscriptionPullCall { hub: self.hub, @@ -564,7 +771,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - No description provided. + /// * `name` - 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". pub fn topics_create(&self, request: Topic, name: &str) -> ProjectTopicCreateCall<'a, C, A> { ProjectTopicCreateCall { hub: self.hub, @@ -578,15 +785,17 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// 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. + /// Returns permissions that a caller has on the specified resource. /// /// # Arguments /// - /// * `topic` - No description provided. - pub fn topics_delete(&self, topic: &str) -> ProjectTopicDeleteCall<'a, C, A> { - ProjectTopicDeleteCall { + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}. + pub fn topics_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectTopicTestIamPermissionCall<'a, C, A> { + ProjectTopicTestIamPermissionCall { hub: self.hub, - _topic: topic.to_string(), + _request: request, + _resource: resource.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -600,7 +809,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `subscription` - No description provided. + /// * `subscription` - The name of the subscription. pub fn subscriptions_modify_push_config(&self, request: ModifyPushConfigRequest, subscription: &str) -> ProjectSubscriptionModifyPushConfigCall<'a, C, A> { ProjectSubscriptionModifyPushConfigCall { hub: self.hub, @@ -619,7 +828,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `topic` - No description provided. + /// * `topic` - The messages in the request will be published on this topic. pub fn topics_publish(&self, request: PublishRequest, topic: &str) -> ProjectTopicPublishCall<'a, C, A> { ProjectTopicPublishCall { hub: self.hub, @@ -637,7 +846,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `topic` - No description provided. + /// * `topic` - The name of the topic to get. pub fn topics_get(&self, topic: &str) -> ProjectTopicGetCall<'a, C, A> { ProjectTopicGetCall { hub: self.hub, @@ -648,6 +857,23 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Gets the access control policy for a resource. May be empty if no such policy or resource exists. + /// + /// # Arguments + /// + /// * `resource` - REQUIRED: The resource for which policy is being requested. Usually some path like projects/{project}. + pub fn topics_get_iam_policy(&self, resource: &str) -> ProjectTopicGetIamPolicyCall<'a, C, A> { + ProjectTopicGetIamPolicyCall { + hub: self.hub, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted. @@ -655,7 +881,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `subscription` - No description provided. + /// * `subscription` - The name of the subscription. pub fn subscriptions_modify_ack_deadline(&self, request: ModifyAckDeadlineRequest, subscription: &str) -> ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> { ProjectSubscriptionModifyAckDeadlineCall { hub: self.hub, @@ -667,32 +893,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Acknowledges the messages associated with the ack tokens in the AcknowledgeRequest. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `subscription` - No description provided. - pub fn subscriptions_acknowledge(&self, request: AcknowledgeRequest, subscription: &str) -> ProjectSubscriptionAcknowledgeCall<'a, C, A> { - ProjectSubscriptionAcknowledgeCall { - hub: self.hub, - _request: request, - _subscription: subscription.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription, or its topic unless the same topic is specified. /// /// # Arguments /// - /// * `subscription` - No description provided. + /// * `subscription` - The subscription to delete. pub fn subscriptions_delete(&self, subscription: &str) -> ProjectSubscriptionDeleteCall<'a, C, A> { ProjectSubscriptionDeleteCall { hub: self.hub, @@ -703,6 +910,25 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on the specified resource. Replaces any existing policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}. + pub fn topics_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectTopicSetIamPolicyCall<'a, C, A> { + ProjectTopicSetIamPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates a subscription to a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic. @@ -710,7 +936,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - No description provided. + /// * `name` - 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". pub fn subscriptions_create(&self, request: Subscription, name: &str) -> ProjectSubscriptionCreateCall<'a, C, A> { ProjectSubscriptionCreateCall { hub: self.hub, @@ -722,13 +948,85 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Acknowledges the messages associated with the ack tokens in the AcknowledgeRequest. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `subscription` - The subscription whose message is being acknowledged. + pub fn subscriptions_acknowledge(&self, request: AcknowledgeRequest, subscription: &str) -> ProjectSubscriptionAcknowledgeCall<'a, C, A> { + ProjectSubscriptionAcknowledgeCall { + hub: self.hub, + _request: request, + _subscription: subscription.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the access control policy for a resource. May be empty if no such policy or resource exists. + /// + /// # Arguments + /// + /// * `resource` - REQUIRED: The resource for which policy is being requested. Usually some path like projects/{project}. + pub fn subscriptions_get_iam_policy(&self, resource: &str) -> ProjectSubscriptionGetIamPolicyCall<'a, C, A> { + ProjectSubscriptionGetIamPolicyCall { + hub: self.hub, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}. + pub fn subscriptions_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectSubscriptionTestIamPermissionCall<'a, C, A> { + ProjectSubscriptionTestIamPermissionCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// 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. + /// + /// # Arguments + /// + /// * `topic` - Name of the topic to delete. + pub fn topics_delete(&self, topic: &str) -> ProjectTopicDeleteCall<'a, C, A> { + ProjectTopicDeleteCall { + hub: self.hub, + _topic: topic.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the configuration details of a subscription. /// /// # Arguments /// - /// * `subscription` - No description provided. + /// * `subscription` - The name of the subscription to get. pub fn subscriptions_get(&self, subscription: &str) -> ProjectSubscriptionGetCall<'a, C, A> { ProjectSubscriptionGetCall { hub: self.hub, @@ -745,7 +1043,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `topic` - No description provided. + /// * `topic` - The name of the topic that subscriptions are attached to. pub fn topics_subscriptions_list(&self, topic: &str) -> ProjectTopicSubscriptionListCall<'a, C, A> { ProjectTopicSubscriptionListCall { hub: self.hub, @@ -764,7 +1062,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `project` - No description provided. + /// * `project` - The name of the cloud project that subscriptions belong to. pub fn subscriptions_list(&self, project: &str) -> ProjectSubscriptionListCall<'a, C, A> { ProjectSubscriptionListCall { hub: self.hub, @@ -776,6 +1074,25 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on the specified resource. Replaces any existing policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}. + pub fn subscriptions_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSubscriptionSetIamPolicyCall<'a, C, A> { + ProjectSubscriptionSetIamPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -974,6 +1291,7 @@ impl<'a, C, A> ProjectTopicListCall<'a, C, A> where C: BorrowMut, } + /// The name of the cloud project that topics belong to. /// /// Sets the *project* path property to the given value. /// @@ -983,12 +1301,14 @@ impl<'a, C, A> ProjectTopicListCall<'a, C, A> where C: BorrowMut, self._project = new_value.to_string(); self } + /// The value returned by the last ListTopicsResponse; indicates that this is a continuation of a prior ListTopics call, and that the system should return the next page of data. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ProjectTopicListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } + /// Maximum number of topics to return. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> ProjectTopicListCall<'a, C, A> { @@ -1015,13 +1335,19 @@ impl<'a, C, A> ProjectTopicListCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *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. Overrides userIp if both are provided. + /// * *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. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *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) -> ProjectTopicListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -1256,6 +1582,7 @@ impl<'a, C, A> ProjectSubscriptionPullCall<'a, C, A> where C: BorrowMut ProjectSubscriptionPullCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionPullCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -1526,6 +1859,7 @@ impl<'a, C, A> ProjectTopicCreateCall<'a, C, A> where C: BorrowMut ProjectTopicCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -1587,9 +1927,9 @@ impl<'a, C, A> ProjectTopicCreateCall<'a, C, A> where C: BorrowMut ProjectTopicCreateCall<'a, C, A> where C: BorrowMut ProjectTopicCreateCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Pubsub::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 = TestIamPermissionsRequest::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.projects().topics_delete("topic") +/// let result = hub.projects().topics_test_iam_permissions(req, "resource") /// .doit(); /// # } /// ``` -pub struct ProjectTopicDeleteCall<'a, C, A> +pub struct ProjectTopicTestIamPermissionCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Pubsub, - _topic: String, + _request: TestIamPermissionsRequest, + _resource: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectTopicDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectTopicTestIamPermissionCall<'a, C, A> {} -impl<'a, C, A> ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectTopicTestIamPermissionCall<'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)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, TestIamPermissionsResponse)> { use url::percent_encoding::{percent_encode, FORM_URLENCODED_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; @@ -1642,11 +1989,11 @@ impl<'a, C, A> ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "pubsub.projects.topics.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("topic", self._topic.to_string())); - for &field in ["alt", "topic"].iter() { + dlg.begin(MethodInfo { id: "pubsub.projects.topics.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -1658,12 +2005,12 @@ impl<'a, C, A> ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["topic"].iter() { + for param_name in ["resource"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -1693,6 +2040,17 @@ impl<'a, C, A> ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut ProjectTopicDeleteCall<'a, C, A> { - self._topic = new_value.to_string(); + pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectTopicTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}. + /// + /// Sets the *resource* 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 resource(mut self, new_value: &str) -> ProjectTopicTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -1780,7 +2152,7 @@ impl<'a, C, A> ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut ProjectTopicDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectTopicTestIamPermissionCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -1794,14 +2166,20 @@ impl<'a, C, A> ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicDeleteCall<'a, C, A> + /// * *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) -> ProjectTopicTestIamPermissionCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -1818,7 +2196,7 @@ impl<'a, C, A> ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectTopicDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectTopicTestIamPermissionCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -2035,6 +2413,7 @@ impl<'a, C, A> ProjectSubscriptionModifyPushConfigCall<'a, C, A> where C: Borrow self._request = new_value; self } + /// The name of the subscription. /// /// Sets the *subscription* path property to the given value. /// @@ -2064,13 +2443,19 @@ impl<'a, C, A> ProjectSubscriptionModifyPushConfigCall<'a, C, A> where C: Borrow /// /// # Additional Parameters /// - /// * *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. Overrides userIp if both are provided. + /// * *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. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *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) -> ProjectSubscriptionModifyPushConfigCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -2305,6 +2690,7 @@ impl<'a, C, A> ProjectTopicPublishCall<'a, C, A> where C: BorrowMut ProjectTopicPublishCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicPublishCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -2544,6 +2936,7 @@ impl<'a, C, A> ProjectTopicGetCall<'a, C, A> where C: BorrowMut, } + /// The name of the topic to get. /// /// Sets the *topic* path property to the given value. /// @@ -2573,13 +2966,19 @@ impl<'a, C, A> ProjectTopicGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *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. Overrides userIp if both are provided. + /// * *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. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *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) -> ProjectTopicGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -2605,6 +3004,252 @@ impl<'a, C, A> ProjectTopicGetCall<'a, C, A> where C: BorrowMut, } +/// Gets the access control policy for a resource. May be empty if no such policy or resource exists. +/// +/// A builder for the *topics.getIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_pubsub1_beta2 as pubsub1_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use pubsub1_beta2::Pubsub; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Pubsub::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.projects().topics_get_iam_policy("resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTopicGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTopicGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectTopicGetIamPolicyCall<'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, Policy)> { + 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: "pubsub.projects.topics.getIamPolicy", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].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://pubsub.googleapis.com/v1beta2/{+resource}:getIamPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].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 ["resource"].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 resource for which policy is being requested. Usually some path like projects/{project}. + /// + /// Sets the *resource* 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 resource(mut self, new_value: &str) -> ProjectTopicGetIamPolicyCall<'a, C, A> { + self._resource = 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) -> ProjectTopicGetIamPolicyCall<'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) -> ProjectTopicGetIamPolicyCall<'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) -> ProjectTopicGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted. /// /// A builder for the *subscriptions.modifyAckDeadline* method supported by a *project* resource. @@ -2814,6 +3459,7 @@ impl<'a, C, A> ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> where C: Borro self._request = new_value; self } + /// The name of the subscription. /// /// Sets the *subscription* path property to the given value. /// @@ -2843,13 +3489,19 @@ impl<'a, C, A> ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> where C: Borro /// /// # Additional Parameters /// - /// * *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. Overrides userIp if both are provided. + /// * *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. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *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) -> ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -2875,276 +3527,6 @@ impl<'a, C, A> ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> where C: Borro } -/// Acknowledges the messages associated with the ack tokens in the AcknowledgeRequest. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error. -/// -/// A builder for the *subscriptions.acknowledge* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_pubsub1_beta2 as pubsub1_beta2; -/// use pubsub1_beta2::AcknowledgeRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use pubsub1_beta2::Pubsub; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Pubsub::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 = AcknowledgeRequest::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.projects().subscriptions_acknowledge(req, "subscription") -/// .doit(); -/// # } -/// ``` -pub struct ProjectSubscriptionAcknowledgeCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Pubsub, - _request: AcknowledgeRequest, - _subscription: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectSubscriptionAcknowledgeCall<'a, C, A> {} - -impl<'a, C, A> ProjectSubscriptionAcknowledgeCall<'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: "pubsub.projects.subscriptions.acknowledge", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("subscription", self._subscription.to_string())); - for &field in ["alt", "subscription"].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://pubsub.googleapis.com/v1beta2/{+subscription}:acknowledge".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+subscription}", "subscription")].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 ["subscription"].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: AcknowledgeRequest) -> ProjectSubscriptionAcknowledgeCall<'a, C, A> { - self._request = new_value; - self - } - /// - /// Sets the *subscription* 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 subscription(mut self, new_value: &str) -> ProjectSubscriptionAcknowledgeCall<'a, C, A> { - self._subscription = 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) -> ProjectSubscriptionAcknowledgeCall<'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 - /// - /// * *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. Overrides userIp if both are provided. - /// * *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. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectSubscriptionAcknowledgeCall<'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) -> ProjectSubscriptionAcknowledgeCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription, or its topic unless the same topic is specified. /// /// A builder for the *subscriptions.delete* method supported by a *project* resource. @@ -3323,6 +3705,7 @@ impl<'a, C, A> ProjectSubscriptionDeleteCall<'a, C, A> where C: BorrowMut ProjectSubscriptionDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -3384,6 +3773,283 @@ impl<'a, C, A> ProjectSubscriptionDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Pubsub::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 = SetIamPolicyRequest::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.projects().topics_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTopicSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTopicSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectTopicSetIamPolicyCall<'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, Policy)> { + 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: "pubsub.projects.topics.setIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].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://pubsub.googleapis.com/v1beta2/{+resource}:setIamPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].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 ["resource"].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: SetIamPolicyRequest) -> ProjectTopicSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}. + /// + /// Sets the *resource* 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 resource(mut self, new_value: &str) -> ProjectTopicSetIamPolicyCall<'a, C, A> { + self._resource = 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) -> ProjectTopicSetIamPolicyCall<'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) -> ProjectTopicSetIamPolicyCall<'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) -> ProjectTopicSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Creates a subscription to a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic. /// /// A builder for the *subscriptions.create* method supported by a *project* resource. @@ -3593,6 +4259,7 @@ impl<'a, C, A> ProjectSubscriptionCreateCall<'a, C, A> where C: BorrowMut ProjectSubscriptionCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -3654,6 +4327,1052 @@ impl<'a, C, A> ProjectSubscriptionCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Pubsub::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 = AcknowledgeRequest::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.projects().subscriptions_acknowledge(req, "subscription") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSubscriptionAcknowledgeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _request: AcknowledgeRequest, + _subscription: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSubscriptionAcknowledgeCall<'a, C, A> {} + +impl<'a, C, A> ProjectSubscriptionAcknowledgeCall<'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: "pubsub.projects.subscriptions.acknowledge", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("subscription", self._subscription.to_string())); + for &field in ["alt", "subscription"].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://pubsub.googleapis.com/v1beta2/{+subscription}:acknowledge".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+subscription}", "subscription")].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 ["subscription"].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: AcknowledgeRequest) -> ProjectSubscriptionAcknowledgeCall<'a, C, A> { + self._request = new_value; + self + } + /// The subscription whose message is being acknowledged. + /// + /// Sets the *subscription* 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 subscription(mut self, new_value: &str) -> ProjectSubscriptionAcknowledgeCall<'a, C, A> { + self._subscription = 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) -> ProjectSubscriptionAcknowledgeCall<'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) -> ProjectSubscriptionAcknowledgeCall<'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) -> ProjectSubscriptionAcknowledgeCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets the access control policy for a resource. May be empty if no such policy or resource exists. +/// +/// A builder for the *subscriptions.getIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_pubsub1_beta2 as pubsub1_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use pubsub1_beta2::Pubsub; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Pubsub::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.projects().subscriptions_get_iam_policy("resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSubscriptionGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSubscriptionGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectSubscriptionGetIamPolicyCall<'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, Policy)> { + 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: "pubsub.projects.subscriptions.getIamPolicy", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].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://pubsub.googleapis.com/v1beta2/{+resource}:getIamPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].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 ["resource"].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 resource for which policy is being requested. Usually some path like projects/{project}. + /// + /// Sets the *resource* 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 resource(mut self, new_value: &str) -> ProjectSubscriptionGetIamPolicyCall<'a, C, A> { + self._resource = 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) -> ProjectSubscriptionGetIamPolicyCall<'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) -> ProjectSubscriptionGetIamPolicyCall<'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) -> ProjectSubscriptionGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// +/// A builder for the *subscriptions.testIamPermissions* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_pubsub1_beta2 as pubsub1_beta2; +/// use pubsub1_beta2::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use pubsub1_beta2::Pubsub; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Pubsub::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 = TestIamPermissionsRequest::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.projects().subscriptions_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSubscriptionTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSubscriptionTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectSubscriptionTestIamPermissionCall<'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, TestIamPermissionsResponse)> { + 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: "pubsub.projects.subscriptions.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].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://pubsub.googleapis.com/v1beta2/{+resource}:testIamPermissions".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].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 ["resource"].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: TestIamPermissionsRequest) -> ProjectSubscriptionTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}. + /// + /// Sets the *resource* 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 resource(mut self, new_value: &str) -> ProjectSubscriptionTestIamPermissionCall<'a, C, A> { + self._resource = 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) -> ProjectSubscriptionTestIamPermissionCall<'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) -> ProjectSubscriptionTestIamPermissionCall<'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) -> ProjectSubscriptionTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// 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. +/// +/// A builder for the *topics.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_pubsub1_beta2 as pubsub1_beta2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use pubsub1_beta2::Pubsub; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Pubsub::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.projects().topics_delete("topic") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTopicDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _topic: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTopicDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectTopicDeleteCall<'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: "pubsub.projects.topics.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("topic", self._topic.to_string())); + for &field in ["alt", "topic"].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://pubsub.googleapis.com/v1beta2/{+topic}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+topic}", "topic")].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 ["topic"].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) + } + } + } + } + + + /// Name of the topic to delete. + /// + /// Sets the *topic* 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 topic(mut self, new_value: &str) -> ProjectTopicDeleteCall<'a, C, A> { + self._topic = 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) -> ProjectTopicDeleteCall<'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) -> ProjectTopicDeleteCall<'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) -> ProjectTopicDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Gets the configuration details of a subscription. /// /// A builder for the *subscriptions.get* method supported by a *project* resource. @@ -3832,6 +5551,7 @@ impl<'a, C, A> ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -3920,8 +5646,8 @@ impl<'a, C, A> ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectTopicSubscriptionListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } + /// Maximum number of subscription names to return. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> ProjectTopicSubscriptionListCall<'a, C, A> { @@ -4122,13 +5851,19 @@ impl<'a, C, A> ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicSubscriptionListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4181,8 +5916,8 @@ impl<'a, C, A> ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectSubscriptionListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } + /// Maximum number of subscriptions to return. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> ProjectSubscriptionListCall<'a, C, A> { @@ -4383,13 +6121,19 @@ impl<'a, C, A> ProjectSubscriptionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4415,3 +6159,280 @@ impl<'a, C, A> ProjectSubscriptionListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Pubsub::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 = SetIamPolicyRequest::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.projects().subscriptions_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSubscriptionSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSubscriptionSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectSubscriptionSetIamPolicyCall<'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, Policy)> { + 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: "pubsub.projects.subscriptions.setIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].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://pubsub.googleapis.com/v1beta2/{+resource}:setIamPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].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 ["resource"].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: SetIamPolicyRequest) -> ProjectSubscriptionSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}. + /// + /// Sets the *resource* 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 resource(mut self, new_value: &str) -> ProjectSubscriptionSetIamPolicyCall<'a, C, A> { + self._resource = 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) -> ProjectSubscriptionSetIamPolicyCall<'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) -> ProjectSubscriptionSetIamPolicyCall<'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) -> ProjectSubscriptionSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + diff --git a/gen/qpxexpress1-cli/Cargo.toml b/gen/qpxexpress1-cli/Cargo.toml index 041856ac90..9bc9f85651 100644 --- a/gen/qpxexpress1-cli/Cargo.toml +++ b/gen/qpxexpress1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["qpxExpress", "google", "cli"] name = "qpxexpress1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/qpxexpress1-cli/src/main.rs b/gen/qpxexpress1-cli/src/main.rs index 9b0e5dbd4f..db416d189f 100644 --- a/gen/qpxexpress1-cli/src/main.rs +++ b/gen/qpxexpress1-cli/src/main.rs @@ -128,6 +128,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -184,7 +185,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() @@ -197,7 +198,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() diff --git a/gen/qpxexpress1/Cargo.toml b/gen/qpxexpress1/Cargo.toml index 8f9685999a..eeda27bf8d 100644 --- a/gen/qpxexpress1/Cargo.toml +++ b/gen/qpxexpress1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/qpxexpress1/src/cmn.rs b/gen/qpxexpress1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/qpxexpress1/src/cmn.rs +++ b/gen/qpxexpress1/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/replicapool1_beta2-cli/Cargo.toml b/gen/replicapool1_beta2-cli/Cargo.toml index 269da2e2a8..5f06f61d5d 100644 --- a/gen/replicapool1_beta2-cli/Cargo.toml +++ b/gen/replicapool1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-replicapool1_beta2-cli" -version = "0.3.0+20150223" +version = "0.3.0+20150311" authors = ["Sebastian Thiel "] description = "A complete library to interact with replicapool (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/replicapool1_beta2-cli" @@ -17,8 +17,8 @@ keywords = ["replicapool", "google", "cli"] name = "replicapool1-beta2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/replicapool1_beta2-cli/README.md b/gen/replicapool1_beta2-cli/README.md index 7a8f61760d..51a61b253d 100644 --- a/gen/replicapool1_beta2-cli/README.md +++ b/gen/replicapool1_beta2-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *replicapool* API at revision *20150223*. The CLI is at version *0.3.0*. +This documentation was generated from the *replicapool* API at revision *20150311*. The CLI is at version *0.3.0*. ```bash replicapool1-beta2 [options] diff --git a/gen/replicapool1_beta2-cli/mkdocs.yml b/gen/replicapool1_beta2-cli/mkdocs.yml index 7268db29be..1d1b2b6f07 100644 --- a/gen/replicapool1_beta2-cli/mkdocs.yml +++ b/gen/replicapool1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: replicapool v0.3.0+20150223 +site_name: replicapool v0.3.0+20150311 site_url: http://byron.github.io/google-apis-rs/google-replicapool1_beta2-cli site_description: Write integrating applications with bcore diff --git a/gen/replicapool1_beta2-cli/src/main.rs b/gen/replicapool1_beta2-cli/src/main.rs index 76a3c457b1..a5c4a15d5a 100644 --- a/gen/replicapool1_beta2-cli/src/main.rs +++ b/gen/replicapool1_beta2-cli/src/main.rs @@ -122,6 +122,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -173,6 +174,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -257,6 +259,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -308,6 +311,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -405,6 +409,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -466,6 +471,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -550,6 +556,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -602,6 +609,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -686,6 +694,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -771,6 +780,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -822,6 +832,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -883,6 +894,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -980,7 +992,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() @@ -993,7 +1005,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() @@ -1476,7 +1488,7 @@ fn main() { let mut app = App::new("replicapool1-beta2") .author("Sebastian Thiel ") - .version("0.3.0+20150223") + .version("0.3.0+20150311") .about("The Google Compute Engine Instance Group Manager API provides groups of homogenous Compute Engine Instances.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_replicapool1_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/replicapool1_beta2/Cargo.toml b/gen/replicapool1_beta2/Cargo.toml index 0805a87fde..8a2a86df40 100644 --- a/gen/replicapool1_beta2/Cargo.toml +++ b/gen/replicapool1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-replicapool1_beta2" -version = "0.1.8+20150223" +version = "0.1.8+20150311" authors = ["Sebastian Thiel "] description = "A complete library to interact with replicapool (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/replicapool1_beta2" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/replicapool1_beta2/README.md b/gen/replicapool1_beta2/README.md index 4ef384f605..f6d49af98f 100644 --- a/gen/replicapool1_beta2/README.md +++ b/gen/replicapool1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-replicapool1_beta2` library allows access to all features of the *Google replicapool* service. -This documentation was generated from *replicapool* crate version *0.1.8+20150223*, where *20150223* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *replicapool* crate version *0.1.8+20150311*, where *20150311* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *replicapool* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/compute/docs/instance-groups/manager/v1beta2). diff --git a/gen/replicapool1_beta2/src/cmn.rs b/gen/replicapool1_beta2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/replicapool1_beta2/src/cmn.rs +++ b/gen/replicapool1_beta2/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/replicapool1_beta2/src/lib.rs b/gen/replicapool1_beta2/src/lib.rs index 83779371a6..ffd2f2e0dc 100644 --- a/gen/replicapool1_beta2/src/lib.rs +++ b/gen/replicapool1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *replicapool* crate version *0.1.8+20150223*, where *20150223* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *replicapool* crate version *0.1.8+20150311*, where *20150311* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *replicapool* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/compute/docs/instance-groups/manager/v1beta2). diff --git a/gen/replicapool1_beta2/src/lib.rs.in b/gen/replicapool1_beta2/src/lib.rs.in index aadb72b06a..e899528d4a 100644 --- a/gen/replicapool1_beta2/src/lib.rs.in +++ b/gen/replicapool1_beta2/src/lib.rs.in @@ -349,6 +349,9 @@ pub struct InstanceGroupManager { pub group: Option, /// An optional textual description of the instance group manager. pub description: Option, + /// The autohealing policy for this managed instance group. You can specify only one value. + #[serde(rename="autoHealingPolicies")] + pub auto_healing_policies: Option>, /// [Output only] Fingerprint of the instance group manager. This field is used for optimistic locking. An up-to-date fingerprint must be provided in order to modify the Instance Group Manager resource. pub fingerprint: Option, /// [Output only] The resource type. Always replicapool#instanceGroupManager. @@ -403,6 +406,20 @@ pub struct InstanceGroupManagersSetTargetPoolsRequest { impl RequestValue for InstanceGroupManagersSetTargetPoolsRequest {} +/// 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 ReplicaPoolAutoHealingPolicy { + /// The URL for the HealthCheck that signals autohealing. + #[serde(rename="healthCheck")] + pub health_check: Option, +} + +impl Part for ReplicaPoolAutoHealingPolicy {} + + /// There is no detailed description. /// /// # Activities diff --git a/gen/replicapoolupdater1_beta1-cli/Cargo.toml b/gen/replicapoolupdater1_beta1-cli/Cargo.toml index 131039e922..bf32d88c5c 100644 --- a/gen/replicapoolupdater1_beta1-cli/Cargo.toml +++ b/gen/replicapoolupdater1_beta1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["replicapoolupdater", "google", "cli"] name = "replicapoolupdater1-beta1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/replicapoolupdater1_beta1-cli/src/main.rs b/gen/replicapoolupdater1_beta1-cli/src/main.rs index e73a364b6b..3733a55d0b 100644 --- a/gen/replicapoolupdater1_beta1-cli/src/main.rs +++ b/gen/replicapoolupdater1_beta1-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -140,6 +141,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -241,6 +243,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -305,6 +308,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -366,6 +370,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -417,6 +422,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -468,6 +474,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -519,6 +526,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -570,6 +578,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -658,7 +667,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() @@ -671,7 +680,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() diff --git a/gen/replicapoolupdater1_beta1/Cargo.toml b/gen/replicapoolupdater1_beta1/Cargo.toml index bd9503e11f..d992ff2b54 100644 --- a/gen/replicapoolupdater1_beta1/Cargo.toml +++ b/gen/replicapoolupdater1_beta1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/replicapoolupdater1_beta1/src/cmn.rs b/gen/replicapoolupdater1_beta1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/replicapoolupdater1_beta1/src/cmn.rs +++ b/gen/replicapoolupdater1_beta1/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/reseller1_sandbox-cli/Cargo.toml b/gen/reseller1_sandbox-cli/Cargo.toml index fd3ba3dcbf..71d1df6411 100644 --- a/gen/reseller1_sandbox-cli/Cargo.toml +++ b/gen/reseller1_sandbox-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-reseller1_sandbox-cli" -version = "0.3.0+20141112" +version = "0.3.0+20150603" authors = ["Sebastian Thiel "] description = "A complete library to interact with reseller (protocol v1sandbox)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/reseller1_sandbox-cli" @@ -17,8 +17,8 @@ keywords = ["reseller", "google", "cli"] name = "reseller1-sandbox" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/reseller1_sandbox-cli/README.md b/gen/reseller1_sandbox-cli/README.md index b710008311..6d7aa7a5fa 100644 --- a/gen/reseller1_sandbox-cli/README.md +++ b/gen/reseller1_sandbox-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *reseller* API at revision *20141112*. The CLI is at version *0.3.0*. +This documentation was generated from the *reseller* API at revision *20150603*. The CLI is at version *0.3.0*. ```bash reseller1-sandbox [options] diff --git a/gen/reseller1_sandbox-cli/mkdocs.yml b/gen/reseller1_sandbox-cli/mkdocs.yml index 37f52022ac..de8b41f147 100644 --- a/gen/reseller1_sandbox-cli/mkdocs.yml +++ b/gen/reseller1_sandbox-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: reseller v0.3.0+20141112 +site_name: reseller v0.3.0+20150603 site_url: http://byron.github.io/google-apis-rs/google-reseller1_sandbox-cli site_description: Write integrating applications with bcore diff --git a/gen/reseller1_sandbox-cli/src/main.rs b/gen/reseller1_sandbox-cli/src/main.rs index e569d2104a..1677d137bf 100644 --- a/gen/reseller1_sandbox-cli/src/main.rs +++ b/gen/reseller1_sandbox-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -192,6 +193,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -291,6 +293,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -390,6 +393,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -441,6 +445,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -531,6 +536,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -616,6 +622,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -703,6 +710,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -798,6 +806,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -833,14 +842,15 @@ impl<'n, 'a> Engine<'n, 'a> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trial-settings.trial-end-time" => Some(("trialSettings.trialEndTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trial-settings.is-in-trial" => Some(("trialSettings.isInTrial", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "transfer-info.transferability-expiration-time" => Some(("transferInfo.transferabilityExpirationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "transfer-info.minimum-transferable-seats" => Some(("transferInfo.minimumTransferableSeats", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "suspension-reasons" => Some(("suspensionReasons", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "resource-ui-url" => Some(("resourceUiUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "seats.kind" => Some(("seats.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "seats.number-of-seats" => Some(("seats.numberOfSeats", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "seats.maximum-number-of-seats" => Some(("seats.maximumNumberOfSeats", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "seats.licensed-number-of-seats" => Some(("seats.licensedNumberOfSeats", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-info.transferability-expiration-time" => Some(("transferInfo.transferabilityExpirationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-info.minimum-transferable-seats" => Some(("transferInfo.minimumTransferableSeats", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "plan.plan-name" => Some(("plan.planName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "plan.commitment-interval.end-time" => Some(("plan.commitmentInterval.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -851,7 +861,7 @@ impl<'n, 'a> Engine<'n, 'a> { "billing-method" => Some(("billingMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-method", "commitment-interval", "creation-time", "customer-id", "end-time", "is-commitment-plan", "is-in-trial", "kind", "licensed-number-of-seats", "maximum-number-of-seats", "minimum-transferable-seats", "number-of-seats", "plan", "plan-name", "purchase-order-id", "renewal-settings", "renewal-type", "resource-ui-url", "seats", "sku-id", "start-time", "status", "subscription-id", "transfer-info", "transferability-expiration-time", "trial-end-time", "trial-settings"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-method", "commitment-interval", "creation-time", "customer-id", "end-time", "is-commitment-plan", "is-in-trial", "kind", "licensed-number-of-seats", "maximum-number-of-seats", "minimum-transferable-seats", "number-of-seats", "plan", "plan-name", "purchase-order-id", "renewal-settings", "renewal-type", "resource-ui-url", "seats", "sku-id", "start-time", "status", "subscription-id", "suspension-reasons", "transfer-info", "transferability-expiration-time", "trial-end-time", "trial-settings"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -908,6 +918,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -975,6 +986,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1026,6 +1038,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1077,6 +1090,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1180,7 +1194,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() @@ -1193,7 +1207,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() @@ -1624,7 +1638,7 @@ fn main() { let mut app = App::new("reseller1-sandbox") .author("Sebastian Thiel ") - .version("0.3.0+20141112") + .version("0.3.0+20150603") .about("Lets you create and manage your customers and their subscriptions.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_reseller1_sandbox_cli") .arg(Arg::with_name("url") diff --git a/gen/reseller1_sandbox/Cargo.toml b/gen/reseller1_sandbox/Cargo.toml index e3148eddcf..15edc23e49 100644 --- a/gen/reseller1_sandbox/Cargo.toml +++ b/gen/reseller1_sandbox/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-reseller1_sandbox" -version = "0.1.8+20141112" +version = "0.1.8+20150603" authors = ["Sebastian Thiel "] description = "A complete library to interact with reseller (protocol v1sandbox)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/reseller1_sandbox" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/reseller1_sandbox/README.md b/gen/reseller1_sandbox/README.md index 1bb1e19126..2fe0d7dd08 100644 --- a/gen/reseller1_sandbox/README.md +++ b/gen/reseller1_sandbox/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-reseller1_sandbox` library allows access to all features of the *Google reseller* service. -This documentation was generated from *reseller* crate version *0.1.8+20141112*, where *20141112* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *reseller* crate version *0.1.8+20150603*, where *20150603* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *reseller* *v1_sandbox* API can be found at the [official documentation site](https://developers.google.com/google-apps/reseller/). diff --git a/gen/reseller1_sandbox/src/cmn.rs b/gen/reseller1_sandbox/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/reseller1_sandbox/src/cmn.rs +++ b/gen/reseller1_sandbox/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/reseller1_sandbox/src/lib.rs b/gen/reseller1_sandbox/src/lib.rs index fd90423685..1ab281238b 100644 --- a/gen/reseller1_sandbox/src/lib.rs +++ b/gen/reseller1_sandbox/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *reseller* crate version *0.1.8+20141112*, where *20141112* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *reseller* crate version *0.1.8+20150603*, where *20150603* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *reseller* *v1_sandbox* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/reseller/). diff --git a/gen/reseller1_sandbox/src/lib.rs.in b/gen/reseller1_sandbox/src/lib.rs.in index d471502929..d2851a2bff 100644 --- a/gen/reseller1_sandbox/src/lib.rs.in +++ b/gen/reseller1_sandbox/src/lib.rs.in @@ -442,9 +442,9 @@ pub struct Subscription { /// Trial Settings of the subscription. #[serde(rename="trialSettings")] pub trial_settings: Option, - /// Transfer related information for the subscription. - #[serde(rename="transferInfo")] - pub transfer_info: Option, + /// Suspension Reasons + #[serde(rename="suspensionReasons")] + pub suspension_reasons: Option>, /// Ui url for subscription resource. #[serde(rename="resourceUiUrl")] pub resource_ui_url: Option, @@ -454,6 +454,9 @@ pub struct Subscription { /// Creation time of this subscription in milliseconds since Unix epoch. #[serde(rename="creationTime")] pub creation_time: Option, + /// Transfer related information for the subscription. + #[serde(rename="transferInfo")] + pub transfer_info: Option, /// Status of the subscription. pub status: Option, /// Plan details of the subscription diff --git a/gen/resourceviews1_beta2-cli/Cargo.toml b/gen/resourceviews1_beta2-cli/Cargo.toml index 6d175340bd..29a1763bdd 100644 --- a/gen/resourceviews1_beta2-cli/Cargo.toml +++ b/gen/resourceviews1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-resourceviews1_beta2-cli" -version = "0.3.0+20150302" +version = "0.3.0+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with resourceviews (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/resourceviews1_beta2-cli" @@ -17,8 +17,8 @@ keywords = ["resourceviews", "google", "cli"] name = "resourceviews1-beta2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/resourceviews1_beta2-cli/README.md b/gen/resourceviews1_beta2-cli/README.md index c045f57685..400a91d8c6 100644 --- a/gen/resourceviews1_beta2-cli/README.md +++ b/gen/resourceviews1_beta2-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *resourceviews* API at revision *20150302*. The CLI is at version *0.3.0*. +This documentation was generated from the *resourceviews* API at revision *20150326*. The CLI is at version *0.3.0*. ```bash resourceviews1-beta2 [options] diff --git a/gen/resourceviews1_beta2-cli/mkdocs.yml b/gen/resourceviews1_beta2-cli/mkdocs.yml index 9e9def0759..01756f5356 100644 --- a/gen/resourceviews1_beta2-cli/mkdocs.yml +++ b/gen/resourceviews1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: resourceviews v0.3.0+20150302 +site_name: resourceviews v0.3.0+20150326 site_url: http://byron.github.io/google-apis-rs/google-resourceviews1_beta2-cli site_description: Write integrating applications with bcore diff --git a/gen/resourceviews1_beta2-cli/src/main.rs b/gen/resourceviews1_beta2-cli/src/main.rs index 97931b3148..b0254a036c 100644 --- a/gen/resourceviews1_beta2-cli/src/main.rs +++ b/gen/resourceviews1_beta2-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -150,6 +151,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -234,6 +236,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -285,6 +288,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -336,6 +340,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -391,6 +396,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -484,6 +490,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -542,6 +549,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -609,6 +617,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -693,6 +702,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -778,6 +788,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -872,7 +883,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() @@ -885,7 +896,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() @@ -1310,7 +1321,7 @@ fn main() { let mut app = App::new("resourceviews1-beta2") .author("Sebastian Thiel ") - .version("0.3.0+20150302") + .version("0.3.0+20150326") .about("The Resource View API allows users to create and manage logical sets of Google Compute Engine instances.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_resourceviews1_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/resourceviews1_beta2/Cargo.toml b/gen/resourceviews1_beta2/Cargo.toml index e66bee7e9a..17b7fccef8 100644 --- a/gen/resourceviews1_beta2/Cargo.toml +++ b/gen/resourceviews1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-resourceviews1_beta2" -version = "0.1.8+20150302" +version = "0.1.8+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with resourceviews (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/resourceviews1_beta2" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/resourceviews1_beta2/README.md b/gen/resourceviews1_beta2/README.md index 14557b235e..675a713595 100644 --- a/gen/resourceviews1_beta2/README.md +++ b/gen/resourceviews1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-resourceviews1_beta2` library allows access to all features of the *Google resourceviews* service. -This documentation was generated from *resourceviews* crate version *0.1.8+20150302*, where *20150302* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *resourceviews* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *resourceviews* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/compute/). diff --git a/gen/resourceviews1_beta2/src/cmn.rs b/gen/resourceviews1_beta2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/resourceviews1_beta2/src/cmn.rs +++ b/gen/resourceviews1_beta2/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/resourceviews1_beta2/src/lib.rs b/gen/resourceviews1_beta2/src/lib.rs index 8926f6f4f6..e99a7511ab 100644 --- a/gen/resourceviews1_beta2/src/lib.rs +++ b/gen/resourceviews1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *resourceviews* crate version *0.1.8+20150302*, where *20150302* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *resourceviews* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *resourceviews* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/compute/). diff --git a/gen/siteverification1-cli/Cargo.toml b/gen/siteverification1-cli/Cargo.toml index dda03e9489..6fa642f6cc 100644 --- a/gen/siteverification1-cli/Cargo.toml +++ b/gen/siteverification1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["siteVerification", "google", "cli"] name = "siteverification1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/siteverification1-cli/src/main.rs b/gen/siteverification1-cli/src/main.rs index 2b439ad94f..6c17c9f0e0 100644 --- a/gen/siteverification1-cli/src/main.rs +++ b/gen/siteverification1-cli/src/main.rs @@ -133,6 +133,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -219,6 +220,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -306,6 +308,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -357,6 +360,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -444,6 +448,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -531,6 +536,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -605,7 +611,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() @@ -618,7 +624,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() diff --git a/gen/siteverification1/Cargo.toml b/gen/siteverification1/Cargo.toml index b220d2d774..1f3158bca3 100644 --- a/gen/siteverification1/Cargo.toml +++ b/gen/siteverification1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/siteverification1/src/cmn.rs b/gen/siteverification1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/siteverification1/src/cmn.rs +++ b/gen/siteverification1/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/spectrum1_explorer-cli/Cargo.toml b/gen/spectrum1_explorer-cli/Cargo.toml index bde029816a..8dc9e0ba75 100644 --- a/gen/spectrum1_explorer-cli/Cargo.toml +++ b/gen/spectrum1_explorer-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["spectrum", "google", "cli"] name = "spectrum1-explorer" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/spectrum1_explorer-cli/src/main.rs b/gen/spectrum1_explorer-cli/src/main.rs index 1dcdca05d1..5618585aac 100644 --- a/gen/spectrum1_explorer-cli/src/main.rs +++ b/gen/spectrum1_explorer-cli/src/main.rs @@ -170,6 +170,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -296,6 +297,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -394,6 +396,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -492,6 +495,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -613,6 +617,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -695,6 +700,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -766,7 +772,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() @@ -779,7 +785,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() diff --git a/gen/spectrum1_explorer/Cargo.toml b/gen/spectrum1_explorer/Cargo.toml index d534085a09..114702a48c 100644 --- a/gen/spectrum1_explorer/Cargo.toml +++ b/gen/spectrum1_explorer/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/spectrum1_explorer/src/cmn.rs b/gen/spectrum1_explorer/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/spectrum1_explorer/src/cmn.rs +++ b/gen/spectrum1_explorer/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/sqladmin1_beta4-cli/Cargo.toml b/gen/sqladmin1_beta4-cli/Cargo.toml index 192ec9e6d7..7f79370004 100644 --- a/gen/sqladmin1_beta4-cli/Cargo.toml +++ b/gen/sqladmin1_beta4-cli/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-sqladmin1_beta4-cli" -version = "0.3.0+20150305" +version = "0.3.0+20150330" authors = ["Sebastian Thiel "] description = "A complete library to interact with SQL Admin (protocol v1beta4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sqladmin1_beta4-cli" -homepage = "https://developers.google.com/cloud-sql/docs/admin-api/" +homepage = "https://cloud.google.com/sql/docs/reference/latest" documentation = "http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli" license = "MIT" keywords = ["sqladmin", "google", "cli"] @@ -17,8 +17,8 @@ keywords = ["sqladmin", "google", "cli"] name = "sqladmin1-beta4" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/sqladmin1_beta4-cli/README.md b/gen/sqladmin1_beta4-cli/README.md index 083d20d250..0631732d3c 100644 --- a/gen/sqladmin1_beta4-cli/README.md +++ b/gen/sqladmin1_beta4-cli/README.md @@ -11,7 +11,7 @@ capabilities. Errors will be printed to standard error, and cause the program's If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. Everything else about the *SQL Admin* API can be found at the -[official documentation site](https://developers.google.com/cloud-sql/docs/admin-api/). +[official documentation site](https://cloud.google.com/sql/docs/reference/latest). # Downloads @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *SQL Admin* API at revision *20150305*. The CLI is at version *0.3.0*. +This documentation was generated from the *SQL Admin* API at revision *20150330*. The CLI is at version *0.3.0*. ```bash sqladmin1-beta4 [options] diff --git a/gen/sqladmin1_beta4-cli/mkdocs.yml b/gen/sqladmin1_beta4-cli/mkdocs.yml index 4cd76b13b0..77f78d5596 100644 --- a/gen/sqladmin1_beta4-cli/mkdocs.yml +++ b/gen/sqladmin1_beta4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: SQL Admin v0.3.0+20150305 +site_name: SQL Admin v0.3.0+20150330 site_url: http://byron.github.io/google-apis-rs/google-sqladmin1_beta4-cli site_description: Write integrating applications with bcore diff --git a/gen/sqladmin1_beta4-cli/src/main.rs b/gen/sqladmin1_beta4-cli/src/main.rs index e770567fbf..f3ba8931c4 100644 --- a/gen/sqladmin1_beta4-cli/src/main.rs +++ b/gen/sqladmin1_beta4-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -147,6 +148,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -198,6 +200,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -249,6 +252,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -340,6 +344,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -391,6 +396,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -482,6 +488,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -573,6 +580,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -624,6 +632,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -712,6 +721,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -763,6 +773,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -852,6 +863,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -903,6 +915,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -992,6 +1005,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1131,6 +1145,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1189,6 +1204,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1328,6 +1344,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1379,6 +1396,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1430,6 +1448,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1481,6 +1500,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1510,10 +1530,11 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "restore-backup-context.instance-id" => Some(("restoreBackupContext.instanceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "restore-backup-context.kind" => Some(("restoreBackupContext.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "restore-backup-context.backup-run-id" => Some(("restoreBackupContext.backupRunId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["backup-run-id", "kind", "restore-backup-context"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["backup-run-id", "instance-id", "kind", "restore-backup-context"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1566,6 +1587,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1617,6 +1639,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1668,6 +1691,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1807,6 +1831,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1858,6 +1883,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1916,6 +1942,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1967,6 +1994,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2018,6 +2046,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2102,6 +2131,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2153,6 +2183,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2204,6 +2235,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2255,6 +2287,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2345,6 +2378,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2396,6 +2430,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2486,6 +2521,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2700,7 +2736,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() @@ -2713,7 +2749,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() @@ -3870,7 +3906,7 @@ fn main() { let mut app = App::new("sqladmin1-beta4") .author("Sebastian Thiel ") - .version("0.3.0+20150305") + .version("0.3.0+20150330") .about("API for Cloud SQL database instance management.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli") .arg(Arg::with_name("url") diff --git a/gen/sqladmin1_beta4/Cargo.toml b/gen/sqladmin1_beta4/Cargo.toml index aa1d5a7a3e..d4ae703e55 100644 --- a/gen/sqladmin1_beta4/Cargo.toml +++ b/gen/sqladmin1_beta4/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-sqladmin1_beta4" -version = "0.1.8+20150305" +version = "0.1.8+20150330" authors = ["Sebastian Thiel "] description = "A complete library to interact with SQL Admin (protocol v1beta4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sqladmin1_beta4" -homepage = "https://developers.google.com/cloud-sql/docs/admin-api/" +homepage = "https://cloud.google.com/sql/docs/reference/latest" documentation = "http://byron.github.io/google-apis-rs/google_sqladmin1_beta4" license = "MIT" keywords = ["sqladmin", "google", "protocol", "web", "api"] @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/sqladmin1_beta4/README.md b/gen/sqladmin1_beta4/README.md index 71cda28969..f3c0b47eef 100644 --- a/gen/sqladmin1_beta4/README.md +++ b/gen/sqladmin1_beta4/README.md @@ -5,10 +5,10 @@ DO NOT EDIT ! --> The `google-sqladmin1_beta4` library allows access to all features of the *Google SQL Admin* service. -This documentation was generated from *SQL Admin* crate version *0.1.8+20150305*, where *20150305* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *SQL Admin* crate version *0.1.8+20150330*, where *20150330* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *SQL Admin* *v1_beta4* API can be found at the -[official documentation site](https://developers.google.com/cloud-sql/docs/admin-api/). +[official documentation site](https://cloud.google.com/sql/docs/reference/latest). # Features Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_sqladmin1_beta4/struct.SQLAdmin.html) ... diff --git a/gen/sqladmin1_beta4/src/cmn.rs b/gen/sqladmin1_beta4/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/sqladmin1_beta4/src/cmn.rs +++ b/gen/sqladmin1_beta4/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/sqladmin1_beta4/src/lib.rs b/gen/sqladmin1_beta4/src/lib.rs index f4f981a690..5a12ca2d9e 100644 --- a/gen/sqladmin1_beta4/src/lib.rs +++ b/gen/sqladmin1_beta4/src/lib.rs @@ -2,10 +2,10 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *SQL Admin* crate version *0.1.8+20150305*, where *20150305* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *SQL Admin* crate version *0.1.8+20150330*, where *20150330* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *SQL Admin* *v1_beta4* API can be found at the -//! [official documentation site](https://developers.google.com/cloud-sql/docs/admin-api/). +//! [official documentation site](https://cloud.google.com/sql/docs/reference/latest). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/sqladmin1_beta4). //! # Features //! diff --git a/gen/sqladmin1_beta4/src/lib.rs.in b/gen/sqladmin1_beta4/src/lib.rs.in index 40bf0c8c38..5c917d9460 100644 --- a/gen/sqladmin1_beta4/src/lib.rs.in +++ b/gen/sqladmin1_beta4/src/lib.rs.in @@ -289,7 +289,7 @@ pub struct SslCert { /// The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z #[serde(rename="createTime")] pub create_time: Option, - /// no description provided + /// The URI of this resource. #[serde(rename="selfLink")] pub self_link: Option, } @@ -304,6 +304,9 @@ impl ResponseResult for SslCert {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RestoreBackupContext { + /// The ID of the instance that the backup was taken from. + #[serde(rename="instanceId")] + pub instance_id: Option, /// This is always sql#restoreBackupContext. pub kind: Option, /// The ID of the backup run to restore from. @@ -1089,6 +1092,7 @@ pub struct DatabaseInstance { /// SUSPENDED: The instance is not available, for example due to problems with billing. /// PENDING_CREATE: The instance is being created. /// MAINTENANCE: The instance is down for maintenance. + /// FAILED: The instance creation failed. /// UNKNOWN_STATE: The state of the instance is unknown. pub state: Option, /// HTTP 1.1 Entity tag for the resource. @@ -1226,7 +1230,7 @@ pub struct Operation { /// The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. #[serde(rename="startTime")] pub start_time: Option, - /// no description provided + /// If errors occurred during processing of this operation, this field will be populated. pub error: Option, /// The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. #[serde(rename="endTime")] diff --git a/gen/storage1-cli/Cargo.toml b/gen/storage1-cli/Cargo.toml index 79980d9055..1c964c25be 100644 --- a/gen/storage1-cli/Cargo.toml +++ b/gen/storage1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["storage", "google", "cli"] name = "storage1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/storage1-cli/src/main.rs b/gen/storage1-cli/src/main.rs index 2b7de65abe..88a6aa138b 100644 --- a/gen/storage1-cli/src/main.rs +++ b/gen/storage1-cli/src/main.rs @@ -133,6 +133,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -228,6 +229,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -279,6 +281,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -374,6 +377,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -469,6 +473,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -581,6 +586,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -691,6 +697,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -755,6 +762,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -871,6 +879,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -987,6 +996,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1168,6 +1178,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1265,6 +1276,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1323,6 +1335,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1420,6 +1433,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1517,6 +1531,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1620,6 +1635,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1721,6 +1737,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1776,6 +1793,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1877,6 +1895,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1978,6 +1997,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2101,8 +2121,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -2250,8 +2272,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -2388,8 +2412,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -2527,7 +2553,9 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); Ok(()) } } @@ -2598,6 +2626,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2727,6 +2756,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2874,6 +2904,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3008,8 +3039,10 @@ impl<'n, 'a> Engine<'n, 'a> { 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(); } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -3123,6 +3156,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3321,7 +3355,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() @@ -3334,7 +3368,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() @@ -4121,7 +4155,7 @@ fn main() { Some(false)), ]), ("copy", - Some(r##"Copies an object to a specified location. Optionally overrides metadata."##), + Some(r##"Copies a source object to a destination object. Optionally overrides metadata."##), "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/objects_copy", vec![ (Some(r##"source-bucket"##), diff --git a/gen/storage1/Cargo.toml b/gen/storage1/Cargo.toml index 663a84eed8..2b914947fe 100644 --- a/gen/storage1/Cargo.toml +++ b/gen/storage1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/storage1/src/cmn.rs b/gen/storage1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/storage1/src/cmn.rs +++ b/gen/storage1/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/storage1/src/lib.rs.in b/gen/storage1/src/lib.rs.in index 57adcaee36..836ba671e0 100644 --- a/gen/storage1/src/lib.rs.in +++ b/gen/storage1/src/lib.rs.in @@ -443,7 +443,7 @@ pub struct Object { pub bucket: Option, /// Access controls on the object. pub acl: Option>, - /// CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64. + /// CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. pub crc32c: Option, /// HTTP 1.1 Entity tag for the object. pub etag: Option, @@ -771,7 +771,7 @@ impl Resource for ObjectAccessControl {} impl ResponseResult for ObjectAccessControl {} -/// A Rewrite response. +/// A rewrite response. /// /// # Activities /// @@ -782,19 +782,19 @@ impl ResponseResult for ObjectAccessControl {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RewriteResponse { - /// no description provided + /// The total size of the object being copied in bytes. This property is always present in the response. #[serde(rename="objectSize")] pub object_size: Option, /// The kind of item this is. pub kind: Option, - /// no description provided + /// A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes. pub resource: Option, - /// no description provided + /// true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response. pub done: Option, - /// no description provided + /// The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response. #[serde(rename="totalBytesRewritten")] pub total_bytes_rewritten: Option, - /// no description provided + /// A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy. #[serde(rename="rewriteToken")] pub rewrite_token: Option, } @@ -1530,7 +1530,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Copies an object to a specified location. Optionally overrides metadata. + /// Copies a source object to a destination object. Optionally overrides metadata. /// /// # Arguments /// @@ -5609,7 +5609,7 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: self._source_generation = Some(new_value.to_string()); self } - /// Include this field (from the previous Rewrite response) on each Rewrite request after the first one, until the Rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request. + /// Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request. /// /// Sets the *rewrite token* query property to the given value. pub fn rewrite_token(mut self, new_value: &str) -> ObjectRewriteCall<'a, C, A> { @@ -5623,7 +5623,7 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: self._projection = Some(new_value.to_string()); self } - /// The maximum number of bytes that will be rewritten per Rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across Rewrite calls else you'll get an error that the rewrite token is invalid. + /// The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid. /// /// Sets the *max bytes rewritten per call* query property to the given value. pub fn max_bytes_rewritten_per_call(mut self, new_value: &str) -> ObjectRewriteCall<'a, C, A> { @@ -8247,7 +8247,7 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa } -/// Copies an object to a specified location. Optionally overrides metadata. +/// Copies a source object to a destination object. Optionally overrides metadata. /// /// This method supports **media download**. To enable it, adjust the builder like this: /// `.param("alt", "media")`. diff --git a/gen/tagmanager1-cli/Cargo.toml b/gen/tagmanager1-cli/Cargo.toml index 3b742dd6eb..146088c7df 100644 --- a/gen/tagmanager1-cli/Cargo.toml +++ b/gen/tagmanager1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-tagmanager1-cli" -version = "0.3.0+20150121" +version = "0.3.0+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with Tag Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager1-cli" @@ -17,8 +17,8 @@ keywords = ["tagmanager", "google", "cli"] name = "tagmanager1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/tagmanager1-cli/README.md b/gen/tagmanager1-cli/README.md index ea3826b9e0..dbf9528da5 100644 --- a/gen/tagmanager1-cli/README.md +++ b/gen/tagmanager1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Tag Manager* API at revision *20150121*. The CLI is at version *0.3.0*. +This documentation was generated from the *Tag Manager* API at revision *20150526*. The CLI is at version *0.3.0*. ```bash tagmanager1 [options] diff --git a/gen/tagmanager1-cli/mkdocs.yml b/gen/tagmanager1-cli/mkdocs.yml index c91ae6614b..e107d21146 100644 --- a/gen/tagmanager1-cli/mkdocs.yml +++ b/gen/tagmanager1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Tag Manager v0.3.0+20150121 +site_name: Tag Manager v0.3.0+20150526 site_url: http://byron.github.io/google-apis-rs/google-tagmanager1-cli site_description: Write integrating applications with bcore diff --git a/gen/tagmanager1-cli/src/main.rs b/gen/tagmanager1-cli/src/main.rs index bc19be81b8..6ee0557903 100644 --- a/gen/tagmanager1-cli/src/main.rs +++ b/gen/tagmanager1-cli/src/main.rs @@ -132,6 +132,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -227,6 +228,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -278,6 +280,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -372,6 +375,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -467,6 +471,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -518,6 +523,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -616,6 +622,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -705,6 +712,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -800,6 +808,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -851,6 +860,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -944,6 +954,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1044,6 +1055,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1139,6 +1151,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1190,6 +1203,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1294,6 +1308,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1410,6 +1425,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1505,6 +1521,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1556,6 +1573,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1676,6 +1694,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1774,6 +1793,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1868,6 +1888,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1963,6 +1984,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2014,6 +2036,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2112,6 +2135,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2198,6 +2222,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2293,6 +2318,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2348,6 +2374,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2403,6 +2430,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2454,6 +2482,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2505,6 +2534,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2610,6 +2640,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2661,6 +2692,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2712,6 +2744,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2799,6 +2832,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2894,6 +2928,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2945,6 +2980,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3032,6 +3068,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3123,6 +3160,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3314,7 +3352,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() @@ -3327,7 +3365,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() @@ -4789,7 +4827,7 @@ fn main() { let mut app = App::new("tagmanager1") .author("Sebastian Thiel ") - .version("0.3.0+20150121") + .version("0.3.0+20150526") .about("API for accessing Tag Manager accounts and containers.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_tagmanager1_cli") .arg(Arg::with_name("url") diff --git a/gen/tagmanager1/Cargo.toml b/gen/tagmanager1/Cargo.toml index ac2ad67fab..723a0b4f98 100644 --- a/gen/tagmanager1/Cargo.toml +++ b/gen/tagmanager1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-tagmanager1" -version = "0.1.8+20150121" +version = "0.1.8+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with Tag Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/tagmanager1/README.md b/gen/tagmanager1/README.md index e52b154ef3..3d47911b46 100644 --- a/gen/tagmanager1/README.md +++ b/gen/tagmanager1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-tagmanager1` library allows access to all features of the *Google Tag Manager* service. -This documentation was generated from *Tag Manager* crate version *0.1.8+20150121*, where *20150121* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Tag Manager* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *Tag Manager* *v1* API can be found at the [official documentation site](https://developers.google.com/tag-manager/api/v1/). diff --git a/gen/tagmanager1/src/cmn.rs b/gen/tagmanager1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/tagmanager1/src/cmn.rs +++ b/gen/tagmanager1/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/tagmanager1/src/lib.rs b/gen/tagmanager1/src/lib.rs index 8b912f0f1b..8af64dc583 100644 --- a/gen/tagmanager1/src/lib.rs +++ b/gen/tagmanager1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Tag Manager* crate version *0.1.8+20150121*, where *20150121* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Tag Manager* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *Tag Manager* *v1* API can be found at the //! [official documentation site](https://developers.google.com/tag-manager/api/v1/). diff --git a/gen/taskqueue1_beta2-cli/Cargo.toml b/gen/taskqueue1_beta2-cli/Cargo.toml index 8a603db04e..34837b8f4a 100644 --- a/gen/taskqueue1_beta2-cli/Cargo.toml +++ b/gen/taskqueue1_beta2-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["taskqueue", "google", "cli"] name = "taskqueue1-beta2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/taskqueue1_beta2-cli/src/main.rs b/gen/taskqueue1_beta2-cli/src/main.rs index f2e1aadab2..90788ce5b3 100644 --- a/gen/taskqueue1_beta2-cli/src/main.rs +++ b/gen/taskqueue1_beta2-cli/src/main.rs @@ -93,6 +93,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -188,6 +189,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -279,6 +281,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -339,6 +342,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -390,6 +394,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -482,6 +487,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -574,6 +580,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -659,7 +666,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() @@ -672,7 +679,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() diff --git a/gen/taskqueue1_beta2/Cargo.toml b/gen/taskqueue1_beta2/Cargo.toml index 1bbc91f946..3a961d4cc9 100644 --- a/gen/taskqueue1_beta2/Cargo.toml +++ b/gen/taskqueue1_beta2/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/taskqueue1_beta2/src/cmn.rs b/gen/taskqueue1_beta2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/taskqueue1_beta2/src/cmn.rs +++ b/gen/taskqueue1_beta2/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/tasks1-cli/Cargo.toml b/gen/tasks1-cli/Cargo.toml index dfa79054b9..aa75cbb0e7 100644 --- a/gen/tasks1-cli/Cargo.toml +++ b/gen/tasks1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["tasks", "google", "cli"] name = "tasks1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/tasks1-cli/src/main.rs b/gen/tasks1-cli/src/main.rs index ec1cc4b5e9..30f34abb8c 100644 --- a/gen/tasks1-cli/src/main.rs +++ b/gen/tasks1-cli/src/main.rs @@ -133,6 +133,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -222,6 +223,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -280,6 +282,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -369,6 +372,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -458,6 +462,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -597,6 +602,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -701,6 +707,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -783,6 +790,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -841,6 +849,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -938,6 +947,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1035,6 +1045,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1138,7 +1149,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() @@ -1151,7 +1162,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() diff --git a/gen/tasks1/Cargo.toml b/gen/tasks1/Cargo.toml index 689d1ce11a..086c473e45 100644 --- a/gen/tasks1/Cargo.toml +++ b/gen/tasks1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/tasks1/src/cmn.rs b/gen/tasks1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/tasks1/src/cmn.rs +++ b/gen/tasks1/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/translate2-cli/Cargo.toml b/gen/translate2-cli/Cargo.toml index f89d2aaa8e..8d6a83d468 100644 --- a/gen/translate2-cli/Cargo.toml +++ b/gen/translate2-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["translate", "google", "cli"] name = "translate2" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/translate2-cli/src/main.rs b/gen/translate2-cli/src/main.rs index ab0821eb32..0e75fe3800 100644 --- a/gen/translate2-cli/src/main.rs +++ b/gen/translate2-cli/src/main.rs @@ -86,6 +86,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -138,6 +139,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -196,6 +198,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -274,7 +277,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() @@ -287,7 +290,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() diff --git a/gen/translate2/Cargo.toml b/gen/translate2/Cargo.toml index 4b540bfcca..684935f603 100644 --- a/gen/translate2/Cargo.toml +++ b/gen/translate2/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/translate2/src/cmn.rs b/gen/translate2/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/translate2/src/cmn.rs +++ b/gen/translate2/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/urlshortener1-cli/Cargo.toml b/gen/urlshortener1-cli/Cargo.toml index 3e5f7a9cc1..0b55e5184c 100644 --- a/gen/urlshortener1-cli/Cargo.toml +++ b/gen/urlshortener1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-urlshortener1-cli" -version = "0.3.0+20150319" +version = "0.3.0+20150519" authors = ["Sebastian Thiel "] description = "A complete library to interact with urlshortener (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/urlshortener1-cli" @@ -17,8 +17,8 @@ keywords = ["urlshortener", "google", "cli"] name = "urlshortener1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/urlshortener1-cli/README.md b/gen/urlshortener1-cli/README.md index c4237d7694..c269f8aecc 100644 --- a/gen/urlshortener1-cli/README.md +++ b/gen/urlshortener1-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *urlshortener* API at revision *20150319*. The CLI is at version *0.3.0*. +This documentation was generated from the *urlshortener* API at revision *20150519*. The CLI is at version *0.3.0*. ```bash urlshortener1 [options] diff --git a/gen/urlshortener1-cli/mkdocs.yml b/gen/urlshortener1-cli/mkdocs.yml index 5492fb559d..74eca6f1fc 100644 --- a/gen/urlshortener1-cli/mkdocs.yml +++ b/gen/urlshortener1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: urlshortener v0.3.0+20150319 +site_name: urlshortener v0.3.0+20150519 site_url: http://byron.github.io/google-apis-rs/google-urlshortener1-cli site_description: Write integrating applications with bcore diff --git a/gen/urlshortener1-cli/src/main.rs b/gen/urlshortener1-cli/src/main.rs index f0e2fb7810..4590852d54 100644 --- a/gen/urlshortener1-cli/src/main.rs +++ b/gen/urlshortener1-cli/src/main.rs @@ -93,6 +93,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -191,6 +192,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -249,6 +251,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -311,7 +314,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() @@ -324,7 +327,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() @@ -426,7 +429,7 @@ fn main() { let mut app = App::new("urlshortener1") .author("Sebastian Thiel ") - .version("0.3.0+20150319") + .version("0.3.0+20150519") .about("Lets you create, inspect, and manage goo.gl short URLs") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_urlshortener1_cli") .arg(Arg::with_name("url") diff --git a/gen/urlshortener1/Cargo.toml b/gen/urlshortener1/Cargo.toml index a596b73ca1..cbae07cf76 100644 --- a/gen/urlshortener1/Cargo.toml +++ b/gen/urlshortener1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-urlshortener1" -version = "0.1.8+20150319" +version = "0.1.8+20150519" authors = ["Sebastian Thiel "] description = "A complete library to interact with urlshortener (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/urlshortener1" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/urlshortener1/README.md b/gen/urlshortener1/README.md index 3ff298b8c0..4dfd1efa5a 100644 --- a/gen/urlshortener1/README.md +++ b/gen/urlshortener1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-urlshortener1` library allows access to all features of the *Google urlshortener* service. -This documentation was generated from *urlshortener* crate version *0.1.8+20150319*, where *20150319* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *urlshortener* crate version *0.1.8+20150519*, where *20150519* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *urlshortener* *v1* API can be found at the [official documentation site](https://developers.google.com/url-shortener/v1/getting_started). diff --git a/gen/urlshortener1/src/cmn.rs b/gen/urlshortener1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/urlshortener1/src/cmn.rs +++ b/gen/urlshortener1/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/urlshortener1/src/lib.rs b/gen/urlshortener1/src/lib.rs index 2aa88f951b..dbd4d624fa 100644 --- a/gen/urlshortener1/src/lib.rs +++ b/gen/urlshortener1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *urlshortener* crate version *0.1.8+20150319*, where *20150319* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *urlshortener* crate version *0.1.8+20150519*, where *20150519* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *urlshortener* *v1* API can be found at the //! [official documentation site](https://developers.google.com/url-shortener/v1/getting_started). diff --git a/gen/webfonts1-cli/Cargo.toml b/gen/webfonts1-cli/Cargo.toml index f6046e3e5a..d302df38d8 100644 --- a/gen/webfonts1-cli/Cargo.toml +++ b/gen/webfonts1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["webfonts", "google", "cli"] name = "webfonts1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/webfonts1-cli/src/main.rs b/gen/webfonts1-cli/src/main.rs index 7c258bfe7f..a0e5985a46 100644 --- a/gen/webfonts1-cli/src/main.rs +++ b/gen/webfonts1-cli/src/main.rs @@ -90,6 +90,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -146,7 +147,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() @@ -159,7 +160,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() diff --git a/gen/webfonts1/Cargo.toml b/gen/webfonts1/Cargo.toml index 104565cb9f..4b67b018ff 100644 --- a/gen/webfonts1/Cargo.toml +++ b/gen/webfonts1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/webfonts1/src/cmn.rs b/gen/webfonts1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/webfonts1/src/cmn.rs +++ b/gen/webfonts1/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/webmasters3-cli/Cargo.toml b/gen/webmasters3-cli/Cargo.toml index 28bac148bb..4e81602864 100644 --- a/gen/webmasters3-cli/Cargo.toml +++ b/gen/webmasters3-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["webmasters", "google", "cli"] name = "webmasters3" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/webmasters3-cli/src/main.rs b/gen/webmasters3-cli/src/main.rs index afbec6b624..ef05b94d1e 100644 --- a/gen/webmasters3-cli/src/main.rs +++ b/gen/webmasters3-cli/src/main.rs @@ -133,6 +133,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -188,6 +189,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -371,6 +373,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -422,6 +425,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -483,6 +487,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -534,6 +539,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -585,6 +591,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -742,7 +749,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() @@ -755,7 +762,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() diff --git a/gen/webmasters3/Cargo.toml b/gen/webmasters3/Cargo.toml index ac1e447381..1cece196f4 100644 --- a/gen/webmasters3/Cargo.toml +++ b/gen/webmasters3/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/webmasters3/src/cmn.rs b/gen/webmasters3/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/webmasters3/src/cmn.rs +++ b/gen/webmasters3/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/youtube3-cli/Cargo.toml b/gen/youtube3-cli/Cargo.toml index 33649a31af..4f5cadcc1b 100644 --- a/gen/youtube3-cli/Cargo.toml +++ b/gen/youtube3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-youtube3-cli" -version = "0.3.0+20150414" +version = "0.3.0+20150529" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtube3-cli" @@ -17,8 +17,8 @@ keywords = ["youtube", "google", "cli"] name = "youtube3" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/youtube3-cli/README.md b/gen/youtube3-cli/README.md index 3582f82b37..569ad2d129 100644 --- a/gen/youtube3-cli/README.md +++ b/gen/youtube3-cli/README.md @@ -24,7 +24,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *YouTube* API at revision *20150414*. The CLI is at version *0.3.0*. +This documentation was generated from the *YouTube* API at revision *20150529*. The CLI is at version *0.3.0*. ```bash youtube3 [options] diff --git a/gen/youtube3-cli/mkdocs.yml b/gen/youtube3-cli/mkdocs.yml index 8af415eee2..83e321e90c 100644 --- a/gen/youtube3-cli/mkdocs.yml +++ b/gen/youtube3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube v0.3.0+20150414 +site_name: YouTube v0.3.0+20150529 site_url: http://byron.github.io/google-apis-rs/google-youtube3-cli site_description: Write integrating applications with bcore diff --git a/gen/youtube3-cli/src/main.rs b/gen/youtube3-cli/src/main.rs index cc281545d5..0f7ddea659 100644 --- a/gen/youtube3-cli/src/main.rs +++ b/gen/youtube3-cli/src/main.rs @@ -204,6 +204,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -280,6 +281,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -292,6 +294,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "on-behalf-of-content-owner" => { + call = call.on_behalf_of_content_owner(value.unwrap_or("")); + }, "on-behalf-of" => { call = call.on_behalf_of(value.unwrap_or("")); }, @@ -311,7 +316,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["on-behalf-of", "debug-project-id-override"].iter().map(|v|*v)); + v.extend(["on-behalf-of-content-owner", "on-behalf-of", "debug-project-id-override"].iter().map(|v|*v)); v } )); } } @@ -350,6 +355,9 @@ impl<'n, 'a> Engine<'n, 'a> { "tfmt" => { call = call.tfmt(value.unwrap_or("")); }, + "on-behalf-of-content-owner" => { + call = call.on_behalf_of_content_owner(value.unwrap_or("")); + }, "on-behalf-of" => { call = call.on_behalf_of(value.unwrap_or("")); }, @@ -372,7 +380,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["tfmt", "on-behalf-of", "tlang", "debug-project-id-override"].iter().map(|v|*v)); + v.extend(["tfmt", "on-behalf-of-content-owner", "on-behalf-of", "tlang", "debug-project-id-override"].iter().map(|v|*v)); v } )); } } @@ -399,6 +407,7 @@ impl<'n, 'a> Engine<'n, 'a> { if !download_mode { } else { io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); } Ok(()) } @@ -463,6 +472,9 @@ impl<'n, 'a> Engine<'n, 'a> { "sync" => { call = call.sync(arg_from_str(value.unwrap_or("false"), err, "sync", "boolean")); }, + "on-behalf-of-content-owner" => { + call = call.on_behalf_of_content_owner(value.unwrap_or("")); + }, "on-behalf-of" => { call = call.on_behalf_of(value.unwrap_or("")); }, @@ -482,7 +494,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["on-behalf-of", "sync", "debug-project-id-override"].iter().map(|v|*v)); + v.extend(["on-behalf-of-content-owner", "on-behalf-of", "sync", "debug-project-id-override"].iter().map(|v|*v)); v } )); } } @@ -513,6 +525,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -525,6 +538,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "on-behalf-of-content-owner" => { + call = call.on_behalf_of_content_owner(value.unwrap_or("")); + }, "on-behalf-of" => { call = call.on_behalf_of(value.unwrap_or("")); }, @@ -547,7 +563,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["on-behalf-of", "id", "debug-project-id-override"].iter().map(|v|*v)); + v.extend(["on-behalf-of-content-owner", "debug-project-id-override", "on-behalf-of", "id"].iter().map(|v|*v)); v } )); } } @@ -574,6 +590,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -637,6 +654,9 @@ impl<'n, 'a> Engine<'n, 'a> { "sync" => { call = call.sync(arg_from_str(value.unwrap_or("false"), err, "sync", "boolean")); }, + "on-behalf-of-content-owner" => { + call = call.on_behalf_of_content_owner(value.unwrap_or("")); + }, "on-behalf-of" => { call = call.on_behalf_of(value.unwrap_or("")); }, @@ -656,7 +676,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["on-behalf-of", "sync", "debug-project-id-override"].iter().map(|v|*v)); + v.extend(["on-behalf-of-content-owner", "on-behalf-of", "sync", "debug-project-id-override"].iter().map(|v|*v)); v } )); } } @@ -687,6 +707,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -781,6 +802,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -934,6 +956,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1001,6 +1024,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1103,6 +1127,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1185,6 +1210,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1368,6 +1394,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1482,6 +1509,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1506,6 +1534,9 @@ impl<'n, 'a> Engine<'n, 'a> { "page-token" => { call = call.page_token(value.unwrap_or("")); }, + "order" => { + call = call.order(value.unwrap_or("")); + }, "moderation-status" => { call = call.moderation_status(value.unwrap_or("")); }, @@ -1534,7 +1565,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["all-threads-related-to-channel-id", "channel-id", "video-id", "max-results", "page-token", "search-terms", "text-format", "id", "moderation-status"].iter().map(|v|*v)); + v.extend(["max-results", "all-threads-related-to-channel-id", "channel-id", "video-id", "moderation-status", "id", "page-token", "search-terms", "text-format", "order"].iter().map(|v|*v)); v } )); } } @@ -1561,6 +1592,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1671,6 +1703,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1817,6 +1850,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -1884,6 +1918,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2078,6 +2113,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2139,6 +2175,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2194,6 +2231,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2249,6 +2287,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2310,6 +2349,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2377,6 +2417,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2460,13 +2501,15 @@ impl<'n, 'a> Engine<'n, 'a> { "status.recording-status" => Some(("status.recordingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.privacy-status" => Some(("status.privacyStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.life-cycle-status" => Some(("status.lifeCycleStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "status.is-default-broadcast" => Some(("status.isDefaultBroadcast", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status.live-broadcast-priority" => Some(("status.liveBroadcastPriority", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "content-details.start-with-slate" => Some(("contentDetails.startWithSlate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "statistics.concurrent-viewers" => Some(("statistics.concurrentViewers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.total-chat-count" => Some(("statistics.totalChatCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "content-details.enable-low-latency" => Some(("contentDetails.enableLowLatency", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.bound-stream-id" => Some(("contentDetails.boundStreamId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.enable-embed" => Some(("contentDetails.enableEmbed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-closed-captions" => Some(("contentDetails.enableClosedCaptions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "content-details.start-with-slate" => Some(("contentDetails.startWithSlate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-content-encryption" => Some(("contentDetails.enableContentEncryption", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.record-from-start" => Some(("contentDetails.recordFromStart", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-dvr" => Some(("contentDetails.enableDvr", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2481,6 +2524,7 @@ impl<'n, 'a> Engine<'n, 'a> { "snippet.scheduled-start-time" => Some(("snippet.scheduledStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.actual-start-time" => Some(("snippet.actualStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.scheduled-end-time" => Some(("snippet.scheduledEndTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snippet.is-default-broadcast" => Some(("snippet.isDefaultBroadcast", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "snippet.thumbnails.default.url" => Some(("snippet.thumbnails.default.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.thumbnails.default.width" => Some(("snippet.thumbnails.default.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "snippet.thumbnails.default.height" => Some(("snippet.thumbnails.default.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -2499,7 +2543,7 @@ impl<'n, 'a> Engine<'n, 'a> { "etag" => Some(("etag", 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!["actual-end-time", "actual-start-time", "bound-stream-id", "broadcast-stream-delay-ms", "channel-id", "content-details", "default", "description", "embed-html", "enable-closed-captions", "enable-content-encryption", "enable-dvr", "enable-embed", "enable-monitor-stream", "etag", "height", "high", "id", "is-default-broadcast", "kind", "life-cycle-status", "live-broadcast-priority", "maxres", "medium", "monitor-stream", "privacy-status", "published-at", "record-from-start", "recording-status", "scheduled-end-time", "scheduled-start-time", "snippet", "standard", "start-with-slate", "status", "thumbnails", "title", "url", "width"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["actual-end-time", "actual-start-time", "bound-stream-id", "broadcast-stream-delay-ms", "channel-id", "concurrent-viewers", "content-details", "default", "description", "embed-html", "enable-closed-captions", "enable-content-encryption", "enable-dvr", "enable-embed", "enable-low-latency", "enable-monitor-stream", "etag", "height", "high", "id", "is-default-broadcast", "kind", "life-cycle-status", "live-broadcast-priority", "maxres", "medium", "monitor-stream", "privacy-status", "published-at", "record-from-start", "recording-status", "scheduled-end-time", "scheduled-start-time", "snippet", "standard", "start-with-slate", "statistics", "status", "thumbnails", "title", "total-chat-count", "url", "width"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2559,6 +2603,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2632,6 +2677,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2690,6 +2736,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2722,13 +2769,15 @@ impl<'n, 'a> Engine<'n, 'a> { "status.recording-status" => Some(("status.recordingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.privacy-status" => Some(("status.privacyStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.life-cycle-status" => Some(("status.lifeCycleStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "status.is-default-broadcast" => Some(("status.isDefaultBroadcast", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status.live-broadcast-priority" => Some(("status.liveBroadcastPriority", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "content-details.start-with-slate" => Some(("contentDetails.startWithSlate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "statistics.concurrent-viewers" => Some(("statistics.concurrentViewers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.total-chat-count" => Some(("statistics.totalChatCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "content-details.enable-low-latency" => Some(("contentDetails.enableLowLatency", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.bound-stream-id" => Some(("contentDetails.boundStreamId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.enable-embed" => Some(("contentDetails.enableEmbed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-closed-captions" => Some(("contentDetails.enableClosedCaptions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "content-details.start-with-slate" => Some(("contentDetails.startWithSlate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-content-encryption" => Some(("contentDetails.enableContentEncryption", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.record-from-start" => Some(("contentDetails.recordFromStart", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-dvr" => Some(("contentDetails.enableDvr", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2743,6 +2792,7 @@ impl<'n, 'a> Engine<'n, 'a> { "snippet.scheduled-start-time" => Some(("snippet.scheduledStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.actual-start-time" => Some(("snippet.actualStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.scheduled-end-time" => Some(("snippet.scheduledEndTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snippet.is-default-broadcast" => Some(("snippet.isDefaultBroadcast", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "snippet.thumbnails.default.url" => Some(("snippet.thumbnails.default.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.thumbnails.default.width" => Some(("snippet.thumbnails.default.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "snippet.thumbnails.default.height" => Some(("snippet.thumbnails.default.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -2761,7 +2811,7 @@ impl<'n, 'a> Engine<'n, 'a> { "etag" => Some(("etag", 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!["actual-end-time", "actual-start-time", "bound-stream-id", "broadcast-stream-delay-ms", "channel-id", "content-details", "default", "description", "embed-html", "enable-closed-captions", "enable-content-encryption", "enable-dvr", "enable-embed", "enable-monitor-stream", "etag", "height", "high", "id", "is-default-broadcast", "kind", "life-cycle-status", "live-broadcast-priority", "maxres", "medium", "monitor-stream", "privacy-status", "published-at", "record-from-start", "recording-status", "scheduled-end-time", "scheduled-start-time", "snippet", "standard", "start-with-slate", "status", "thumbnails", "title", "url", "width"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["actual-end-time", "actual-start-time", "bound-stream-id", "broadcast-stream-delay-ms", "channel-id", "concurrent-viewers", "content-details", "default", "description", "embed-html", "enable-closed-captions", "enable-content-encryption", "enable-dvr", "enable-embed", "enable-low-latency", "enable-monitor-stream", "etag", "height", "high", "id", "is-default-broadcast", "kind", "life-cycle-status", "live-broadcast-priority", "maxres", "medium", "monitor-stream", "privacy-status", "published-at", "record-from-start", "recording-status", "scheduled-end-time", "scheduled-start-time", "snippet", "standard", "start-with-slate", "statistics", "status", "thumbnails", "title", "total-chat-count", "url", "width"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2821,6 +2871,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -2901,8 +2952,9 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "status.is-default-stream" => Some(("status.isDefaultStream", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status.stream-status" => Some(("status.streamStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.health-status.status" => Some(("status.healthStatus.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.health-status.last-update-time-s" => Some(("status.healthStatus.lastUpdateTimeS", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.is-reusable" => Some(("contentDetails.isReusable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.closed-captions-ingestion-url" => Some(("contentDetails.closedCaptionsIngestionUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2911,6 +2963,7 @@ impl<'n, 'a> Engine<'n, 'a> { "cdn.ingestion-info.stream-name" => Some(("cdn.ingestionInfo.streamName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn.ingestion-info.ingestion-address" => Some(("cdn.ingestionInfo.ingestionAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn.format" => Some(("cdn.format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snippet.is-default-stream" => Some(("snippet.isDefaultStream", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "snippet.channel-id" => Some(("snippet.channelId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.description" => Some(("snippet.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.published-at" => Some(("snippet.publishedAt", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2918,7 +2971,7 @@ impl<'n, 'a> Engine<'n, 'a> { "etag" => Some(("etag", 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!["backup-ingestion-address", "cdn", "channel-id", "closed-captions-ingestion-url", "content-details", "description", "etag", "format", "id", "ingestion-address", "ingestion-info", "ingestion-type", "is-default-stream", "is-reusable", "kind", "published-at", "snippet", "status", "stream-name", "stream-status", "title"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["backup-ingestion-address", "cdn", "channel-id", "closed-captions-ingestion-url", "content-details", "description", "etag", "format", "health-status", "id", "ingestion-address", "ingestion-info", "ingestion-type", "is-default-stream", "is-reusable", "kind", "last-update-time-s", "published-at", "snippet", "status", "stream-name", "stream-status", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2978,6 +3031,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3048,6 +3102,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3077,8 +3132,9 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "status.is-default-stream" => Some(("status.isDefaultStream", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status.stream-status" => Some(("status.streamStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.health-status.status" => Some(("status.healthStatus.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.health-status.last-update-time-s" => Some(("status.healthStatus.lastUpdateTimeS", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.is-reusable" => Some(("contentDetails.isReusable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.closed-captions-ingestion-url" => Some(("contentDetails.closedCaptionsIngestionUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3087,6 +3143,7 @@ impl<'n, 'a> Engine<'n, 'a> { "cdn.ingestion-info.stream-name" => Some(("cdn.ingestionInfo.streamName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn.ingestion-info.ingestion-address" => Some(("cdn.ingestionInfo.ingestionAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn.format" => Some(("cdn.format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snippet.is-default-stream" => Some(("snippet.isDefaultStream", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "snippet.channel-id" => Some(("snippet.channelId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.description" => Some(("snippet.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.published-at" => Some(("snippet.publishedAt", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3094,7 +3151,7 @@ impl<'n, 'a> Engine<'n, 'a> { "etag" => Some(("etag", 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!["backup-ingestion-address", "cdn", "channel-id", "closed-captions-ingestion-url", "content-details", "description", "etag", "format", "id", "ingestion-address", "ingestion-info", "ingestion-type", "is-default-stream", "is-reusable", "kind", "published-at", "snippet", "status", "stream-name", "stream-status", "title"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["backup-ingestion-address", "cdn", "channel-id", "closed-captions-ingestion-url", "content-details", "description", "etag", "format", "health-status", "id", "ingestion-address", "ingestion-info", "ingestion-type", "is-default-stream", "is-reusable", "kind", "last-update-time-s", "published-at", "snippet", "status", "stream-name", "stream-status", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3154,6 +3211,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3319,6 +3377,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3389,6 +3448,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3506,6 +3566,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3674,6 +3735,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3750,6 +3812,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -3867,6 +3930,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4009,6 +4073,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4184,6 +4249,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4266,6 +4332,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4325,6 +4392,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4380,6 +4448,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4441,6 +4510,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4544,6 +4614,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4688,6 +4759,7 @@ impl<'n, 'a> Engine<'n, 'a> { "file-details.file-size" => Some(("fileDetails.fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.description" => Some(("snippet.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.tags" => Some(("snippet.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "snippet.default-audio-language" => Some(("snippet.defaultAudioLanguage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.channel-id" => Some(("snippet.channelId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.published-at" => Some(("snippet.publishedAt", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.live-broadcast-content" => Some(("snippet.liveBroadcastContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -4732,7 +4804,7 @@ impl<'n, 'a> Engine<'n, 'a> { "recording-details.location.longitude" => Some(("recordingDetails.location.longitude", 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!["acb-rating", "access", "actual-end-time", "actual-start-time", "agcom-rating", "age-gating", "alcohol-content", "allowed", "altitude", "anatel-rating", "bbfc-rating", "bfvc-rating", "bitrate-bps", "blocked", "bmukk-rating", "caption", "category-id", "catv-rating", "catvfr-rating", "cbfc-rating", "ccc-rating", "cce-rating", "channel-id", "channel-title", "chfilm-rating", "chvrs-rating", "cicf-rating", "cna-rating", "comment-count", "concurrent-viewers", "container", "content-details", "content-rating", "country-restriction", "creation-time", "csa-rating", "cscf-rating", "czfilm-rating", "default", "default-language", "definition", "description", "dimension", "dislike-count", "djctq-rating", "djctq-rating-reasons", "duration", "duration-ms", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-html", "embeddable", "etag", "exception", "failure-reason", "favorite-count", "fcbm-rating", "fco-rating", "file-details", "file-details-availability", "file-name", "file-size", "file-type", "fmoc-rating", "fpb-rating", "fsk-rating", "grfilm-rating", "height", "high", "icaa-rating", "id", "ifco-rating", "ilfilm-rating", "incaa-rating", "kfcb-rating", "kijkwijzer-rating", "kind", "kmrb-rating", "latitude", "license", "licensed-content", "like-count", "live-broadcast-content", "live-streaming-details", "localized", "location", "location-description", "longitude", "lsf-rating", "maxres", "mccaa-rating", "mccyp-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mtrcb-rating", "nbc-rating", "nbcpl-rating", "nfrc-rating", "nfvcb-rating", "nkclv-rating", "oflc-rating", "parts-processed", "parts-total", "pefilm-rating", "player", "privacy-status", "processing-details", "processing-errors", "processing-failure-reason", "processing-hints", "processing-issues-availability", "processing-progress", "processing-status", "processing-warnings", "project-details", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "recording-location", "region-restriction", "rejection-reason", "relevant-topic-ids", "resorteviolencia-rating", "restricted", "rtc-rating", "rte-rating", "russia-rating", "scheduled-end-time", "scheduled-start-time", "skfilm-rating", "smais-rating", "smsa-rating", "snippet", "standard", "statistics", "status", "suggestions", "tag-suggestions-availability", "tags", "thumbnails", "thumbnails-availability", "time-left-ms", "title", "topic-details", "topic-ids", "tvpg-rating", "upload-status", "url", "video-game-rating", "view-count", "width", "yt-rating"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["acb-rating", "access", "actual-end-time", "actual-start-time", "agcom-rating", "age-gating", "alcohol-content", "allowed", "altitude", "anatel-rating", "bbfc-rating", "bfvc-rating", "bitrate-bps", "blocked", "bmukk-rating", "caption", "category-id", "catv-rating", "catvfr-rating", "cbfc-rating", "ccc-rating", "cce-rating", "channel-id", "channel-title", "chfilm-rating", "chvrs-rating", "cicf-rating", "cna-rating", "comment-count", "concurrent-viewers", "container", "content-details", "content-rating", "country-restriction", "creation-time", "csa-rating", "cscf-rating", "czfilm-rating", "default", "default-audio-language", "default-language", "definition", "description", "dimension", "dislike-count", "djctq-rating", "djctq-rating-reasons", "duration", "duration-ms", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-html", "embeddable", "etag", "exception", "failure-reason", "favorite-count", "fcbm-rating", "fco-rating", "file-details", "file-details-availability", "file-name", "file-size", "file-type", "fmoc-rating", "fpb-rating", "fsk-rating", "grfilm-rating", "height", "high", "icaa-rating", "id", "ifco-rating", "ilfilm-rating", "incaa-rating", "kfcb-rating", "kijkwijzer-rating", "kind", "kmrb-rating", "latitude", "license", "licensed-content", "like-count", "live-broadcast-content", "live-streaming-details", "localized", "location", "location-description", "longitude", "lsf-rating", "maxres", "mccaa-rating", "mccyp-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mtrcb-rating", "nbc-rating", "nbcpl-rating", "nfrc-rating", "nfvcb-rating", "nkclv-rating", "oflc-rating", "parts-processed", "parts-total", "pefilm-rating", "player", "privacy-status", "processing-details", "processing-errors", "processing-failure-reason", "processing-hints", "processing-issues-availability", "processing-progress", "processing-status", "processing-warnings", "project-details", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "recording-location", "region-restriction", "rejection-reason", "relevant-topic-ids", "resorteviolencia-rating", "restricted", "rtc-rating", "rte-rating", "russia-rating", "scheduled-end-time", "scheduled-start-time", "skfilm-rating", "smais-rating", "smsa-rating", "snippet", "standard", "statistics", "status", "suggestions", "tag-suggestions-availability", "tags", "thumbnails", "thumbnails-availability", "time-left-ms", "title", "topic-details", "topic-ids", "tvpg-rating", "upload-status", "url", "video-game-rating", "view-count", "width", "yt-rating"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4805,6 +4877,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4844,6 +4917,9 @@ impl<'n, 'a> Engine<'n, 'a> { "hl" => { call = call.hl(value.unwrap_or("")); }, + "debug-project-id-override" => { + call = call.debug_project_id_override(value.unwrap_or("")); + }, "chart" => { call = call.chart(value.unwrap_or("")); }, @@ -4860,7 +4936,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["on-behalf-of-content-owner", "region-code", "page-token", "locale", "chart", "max-results", "video-category-id", "hl", "my-rating", "id"].iter().map(|v|*v)); + v.extend(["on-behalf-of-content-owner", "region-code", "page-token", "locale", "chart", "max-results", "video-category-id", "debug-project-id-override", "hl", "my-rating", "id"].iter().map(|v|*v)); v } )); } } @@ -4887,6 +4963,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -4899,9 +4976,6 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { - "on-behalf-of-content-owner" => { - call = call.on_behalf_of_content_owner(value.unwrap_or("")); - }, _ => { let mut found = false; for param in &self.gp { @@ -4915,7 +4989,6 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["on-behalf-of-content-owner"].iter().map(|v|*v)); v } )); } } @@ -5164,6 +5237,7 @@ impl<'n, 'a> Engine<'n, 'a> { "file-details.file-size" => Some(("fileDetails.fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.description" => Some(("snippet.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.tags" => Some(("snippet.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "snippet.default-audio-language" => Some(("snippet.defaultAudioLanguage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.channel-id" => Some(("snippet.channelId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.published-at" => Some(("snippet.publishedAt", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.live-broadcast-content" => Some(("snippet.liveBroadcastContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5208,7 +5282,7 @@ impl<'n, 'a> Engine<'n, 'a> { "recording-details.location.longitude" => Some(("recordingDetails.location.longitude", 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!["acb-rating", "access", "actual-end-time", "actual-start-time", "agcom-rating", "age-gating", "alcohol-content", "allowed", "altitude", "anatel-rating", "bbfc-rating", "bfvc-rating", "bitrate-bps", "blocked", "bmukk-rating", "caption", "category-id", "catv-rating", "catvfr-rating", "cbfc-rating", "ccc-rating", "cce-rating", "channel-id", "channel-title", "chfilm-rating", "chvrs-rating", "cicf-rating", "cna-rating", "comment-count", "concurrent-viewers", "container", "content-details", "content-rating", "country-restriction", "creation-time", "csa-rating", "cscf-rating", "czfilm-rating", "default", "default-language", "definition", "description", "dimension", "dislike-count", "djctq-rating", "djctq-rating-reasons", "duration", "duration-ms", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-html", "embeddable", "etag", "exception", "failure-reason", "favorite-count", "fcbm-rating", "fco-rating", "file-details", "file-details-availability", "file-name", "file-size", "file-type", "fmoc-rating", "fpb-rating", "fsk-rating", "grfilm-rating", "height", "high", "icaa-rating", "id", "ifco-rating", "ilfilm-rating", "incaa-rating", "kfcb-rating", "kijkwijzer-rating", "kind", "kmrb-rating", "latitude", "license", "licensed-content", "like-count", "live-broadcast-content", "live-streaming-details", "localized", "location", "location-description", "longitude", "lsf-rating", "maxres", "mccaa-rating", "mccyp-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mtrcb-rating", "nbc-rating", "nbcpl-rating", "nfrc-rating", "nfvcb-rating", "nkclv-rating", "oflc-rating", "parts-processed", "parts-total", "pefilm-rating", "player", "privacy-status", "processing-details", "processing-errors", "processing-failure-reason", "processing-hints", "processing-issues-availability", "processing-progress", "processing-status", "processing-warnings", "project-details", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "recording-location", "region-restriction", "rejection-reason", "relevant-topic-ids", "resorteviolencia-rating", "restricted", "rtc-rating", "rte-rating", "russia-rating", "scheduled-end-time", "scheduled-start-time", "skfilm-rating", "smais-rating", "smsa-rating", "snippet", "standard", "statistics", "status", "suggestions", "tag-suggestions-availability", "tags", "thumbnails", "thumbnails-availability", "time-left-ms", "title", "topic-details", "topic-ids", "tvpg-rating", "upload-status", "url", "video-game-rating", "view-count", "width", "yt-rating"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["acb-rating", "access", "actual-end-time", "actual-start-time", "agcom-rating", "age-gating", "alcohol-content", "allowed", "altitude", "anatel-rating", "bbfc-rating", "bfvc-rating", "bitrate-bps", "blocked", "bmukk-rating", "caption", "category-id", "catv-rating", "catvfr-rating", "cbfc-rating", "ccc-rating", "cce-rating", "channel-id", "channel-title", "chfilm-rating", "chvrs-rating", "cicf-rating", "cna-rating", "comment-count", "concurrent-viewers", "container", "content-details", "content-rating", "country-restriction", "creation-time", "csa-rating", "cscf-rating", "czfilm-rating", "default", "default-audio-language", "default-language", "definition", "description", "dimension", "dislike-count", "djctq-rating", "djctq-rating-reasons", "duration", "duration-ms", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-html", "embeddable", "etag", "exception", "failure-reason", "favorite-count", "fcbm-rating", "fco-rating", "file-details", "file-details-availability", "file-name", "file-size", "file-type", "fmoc-rating", "fpb-rating", "fsk-rating", "grfilm-rating", "height", "high", "icaa-rating", "id", "ifco-rating", "ilfilm-rating", "incaa-rating", "kfcb-rating", "kijkwijzer-rating", "kind", "kmrb-rating", "latitude", "license", "licensed-content", "like-count", "live-broadcast-content", "live-streaming-details", "localized", "location", "location-description", "longitude", "lsf-rating", "maxres", "mccaa-rating", "mccyp-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mtrcb-rating", "nbc-rating", "nbcpl-rating", "nfrc-rating", "nfvcb-rating", "nkclv-rating", "oflc-rating", "parts-processed", "parts-total", "pefilm-rating", "player", "privacy-status", "processing-details", "processing-errors", "processing-failure-reason", "processing-hints", "processing-issues-availability", "processing-progress", "processing-status", "processing-warnings", "project-details", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "recording-location", "region-restriction", "rejection-reason", "relevant-topic-ids", "resorteviolencia-rating", "restricted", "rtc-rating", "rte-rating", "russia-rating", "scheduled-end-time", "scheduled-start-time", "skfilm-rating", "smais-rating", "smsa-rating", "snippet", "standard", "statistics", "status", "suggestions", "tag-suggestions-availability", "tags", "thumbnails", "thumbnails-availability", "time-left-ms", "title", "topic-details", "topic-ids", "tvpg-rating", "upload-status", "url", "video-game-rating", "view-count", "width", "yt-rating"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5265,6 +5339,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -5815,7 +5890,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() @@ -5828,7 +5903,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() @@ -5895,9 +5970,9 @@ fn main() { vec![ (Some(r##"part"##), None, - Some(r##"The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails. + Some(r##"The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. - If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties."##), + If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties."##), Some(true), Some(false)), @@ -6169,7 +6244,7 @@ fn main() { vec![ (Some(r##"part"##), None, - Some(r##"The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, statistics, topicDetails, and invideoPromotion. + Some(r##"The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties."##), Some(true), @@ -6188,7 +6263,7 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates a channel's metadata."##), + Some(r##"Updates a channel's metadata. Note that this method currently only supports updates to the channel resource's brandingSettings and invideoPromotion objects and their child properties."##), "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/channels_update", vec![ (Some(r##"kv"##), @@ -6213,7 +6288,7 @@ fn main() { ("comment-threads", "methods: 'insert', 'list' and 'update'", vec![ ("insert", - Some(r##"Creates a new comment thread and top level comment."##), + Some(r##"Creates a new top-level comment. To add a reply to an existing comment, use the comments.insert method instead."##), "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/comment-threads_insert", vec![ (Some(r##"kv"##), @@ -6240,7 +6315,7 @@ fn main() { vec![ (Some(r##"part"##), None, - Some(r##"The part parameter specifies the commentThread resource parts that the API response will include. Supported values are id, snippet and replies."##), + Some(r##"The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include."##), Some(true), Some(false)), @@ -6257,7 +6332,7 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Modifies an existing comment."##), + Some(r##"Modifies the top-level comment in a comment thread."##), "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/comment-threads_update", vec![ (Some(r##"kv"##), @@ -6287,7 +6362,7 @@ fn main() { vec![ (Some(r##"id"##), None, - Some(r##"The id parameter specifies the comment ID for the resource that should be deleted."##), + Some(r##"The id parameter specifies the comment ID for the resource that is being deleted."##), Some(true), Some(false)), @@ -6298,9 +6373,7 @@ fn main() { Some(true)), ]), ("insert", - Some(r##"Creates a new comment. - - Note: to create a top level comment it is also necessary to create a comment thread. Both are accomplished through the commentThreads resource."##), + Some(r##"Creates a reply to an existing comment. Note: To create a top-level comment, use the commentThreads.insert method."##), "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/comments_insert", vec![ (Some(r##"kv"##), @@ -6327,7 +6400,7 @@ fn main() { vec![ (Some(r##"part"##), None, - Some(r##"The part parameter specifies the comment resource parts that the API response will include. Supported values are id and snippet."##), + Some(r##"The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include."##), Some(true), Some(false)), @@ -6344,12 +6417,12 @@ fn main() { Some(false)), ]), ("mark-as-spam", - Some(r##"Expresses the caller's opinion that a comment is spam."##), + Some(r##"Expresses the caller's opinion that one or more comments should be flagged as spam."##), "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/comments_mark-as-spam", vec![ (Some(r##"id"##), None, - Some(r##"The id parameter specifies a comma-separated list of IDs of comments which should get flagged as spam."##), + Some(r##"The id parameter specifies a comma-separated list of IDs of comments that the caller believes should be classified as spam."##), Some(true), Some(false)), @@ -6360,18 +6433,18 @@ fn main() { Some(true)), ]), ("set-moderation-status", - Some(r##"Sets the moderation status of one or more comments."##), + Some(r##"Sets the moderation status of one or more comments. The API request must be authorized by the owner of the channel or video associated with the comments."##), "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/comments_set-moderation-status", vec![ (Some(r##"id"##), None, - Some(r##"The id parameter specifies a comma-separated list of IDs of comments whose moderation status should be updated."##), + Some(r##"The id parameter specifies a comma-separated list of IDs that identify the comments for which you are updating the moderation status."##), Some(true), Some(false)), (Some(r##"moderation-status"##), None, - Some(r##"Determines the new moderation status of the specified comments."##), + Some(r##"Identifies the new moderation status of the specified comments."##), Some(true), Some(false)), @@ -6382,7 +6455,7 @@ fn main() { Some(true)), ]), ("update", - Some(r##"Modifies an existing comment."##), + Some(r##"Modifies a comment."##), "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/comments_update", vec![ (Some(r##"kv"##), @@ -6412,9 +6485,7 @@ fn main() { vec![ (Some(r##"part"##), None, - Some(r##"The part parameter specifies a comma-separated list of one or more guideCategory resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet. - - If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a guideCategory resource, the snippet property contains other properties, such as the category's title. If you set part=snippet, the API response will also contain all of those nested properties."##), + Some(r##"The part parameter specifies the guideCategory resource properties that the API response will include. Set the parameter value to snippet."##), Some(true), Some(false)), @@ -6434,12 +6505,12 @@ fn main() { ("i18n-languages", "methods: 'list'", vec![ ("list", - Some(r##"Returns a list of supported languages."##), + Some(r##"Returns a list of application languages that the YouTube website supports."##), "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/i18n-languages_list", vec![ (Some(r##"part"##), None, - Some(r##"The part parameter specifies a comma-separated list of one or more i18nLanguage resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet."##), + Some(r##"The part parameter specifies the i18nLanguage resource properties that the API response will include. Set the parameter value to snippet."##), Some(true), Some(false)), @@ -6459,12 +6530,12 @@ fn main() { ("i18n-regions", "methods: 'list'", vec![ ("list", - Some(r##"Returns a list of supported regions."##), + Some(r##"Returns a list of content regions that the YouTube website supports."##), "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/i18n-regions_list", vec![ (Some(r##"part"##), None, - Some(r##"The part parameter specifies a comma-separated list of one or more i18nRegion resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet."##), + Some(r##"The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet."##), Some(true), Some(false)), @@ -6484,7 +6555,7 @@ fn main() { ("live-broadcasts", "methods: 'bind', 'control', 'delete', 'insert', 'list', 'transition' and 'update'", vec![ ("bind", - Some(r##"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."##), + Some(r##"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."##), "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/live-broadcasts_bind", vec![ (Some(r##"id"##), @@ -6787,7 +6858,7 @@ fn main() { vec![ (Some(r##"part"##), None, - Some(r##"The part parameter specifies a comma-separated list of one or more playlistItem 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. + Some(r##"The part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties."##), Some(true), @@ -6874,7 +6945,7 @@ fn main() { vec![ (Some(r##"part"##), None, - Some(r##"The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, status, and contentDetails. + Some(r##"The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties."##), Some(true), @@ -6923,9 +6994,7 @@ fn main() { vec![ (Some(r##"part"##), None, - Some(r##"The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet. - - If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a search result, the snippet property contains other properties that identify the result's title, description, and so forth. If you set part=snippet, the API response will also contain all of those nested properties."##), + Some(r##"The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. Set the parameter value to snippet."##), Some(true), Some(false)), @@ -6988,7 +7057,7 @@ fn main() { vec![ (Some(r##"part"##), None, - Some(r##"The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails. + Some(r##"The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties."##), Some(true), @@ -7071,7 +7140,7 @@ fn main() { vec![ (Some(r##"part"##), None, - Some(r##"The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet."##), + Some(r##"The part parameter specifies the videoCategory resource properties that the API response will include. Set the parameter value to snippet."##), Some(true), Some(false)), @@ -7162,7 +7231,7 @@ fn main() { vec![ (Some(r##"part"##), None, - Some(r##"The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, fileDetails, liveStreamingDetails, localizations, player, processingDetails, recordingDetails, statistics, status, suggestions, and topicDetails. + Some(r##"The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties."##), Some(true), @@ -7249,7 +7318,7 @@ fn main() { vec![ (Some(r##"channel-id"##), None, - Some(r##"The channelId parameter specifies a YouTube channel ID for which the watermark is being provided."##), + Some(r##"The channelId parameter specifies the YouTube channel ID for which the watermark is being provided."##), Some(true), Some(false)), @@ -7272,12 +7341,12 @@ fn main() { Some(true)), ]), ("unset", - Some(r##"Deletes a watermark."##), + Some(r##"Deletes a channel's watermark image."##), "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/watermarks_unset", vec![ (Some(r##"channel-id"##), None, - Some(r##"The channelId parameter specifies a YouTube channel ID for which the watermark is being unset."##), + Some(r##"The channelId parameter specifies the YouTube channel ID for which the watermark is being unset."##), Some(true), Some(false)), @@ -7293,7 +7362,7 @@ fn main() { let mut app = App::new("youtube3") .author("Sebastian Thiel ") - .version("0.3.0+20150414") + .version("0.3.0+20150529") .about("Programmatic access to YouTube features.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_youtube3_cli") .arg(Arg::with_name("url") diff --git a/gen/youtube3/README.md b/gen/youtube3/README.md index 9ba44349c4..525900b3de 100644 --- a/gen/youtube3/README.md +++ b/gen/youtube3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-youtube3` library allows access to all features of the *Google YouTube* service. -This documentation was generated from *YouTube* crate version *0.1.8+20150414*, where *20150414* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *YouTube* crate version *0.1.8+20150529*, where *20150529* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. Everything else about the *YouTube* *v3* API can be found at the [official documentation site](https://developers.google.com/youtube/v3). @@ -165,7 +165,8 @@ let result = hub.videos().list("part") .locale("accusam") .id("takimata") .hl("justo") - .chart("amet.") + .debug_project_id_override("amet.") + .chart("erat") .doit(); match result { diff --git a/gen/youtube3/cargo.toml b/gen/youtube3/cargo.toml index 17659021fb..f0ff56e041 100644 --- a/gen/youtube3/cargo.toml +++ b/gen/youtube3/cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-youtube3" -version = "0.1.8+20150414" +version = "0.1.8+20150529" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtube3" @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/youtube3/src/cmn.rs b/gen/youtube3/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/youtube3/src/cmn.rs +++ b/gen/youtube3/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/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index 7cc93fcbcc..38d77b22fd 100644 --- a/gen/youtube3/src/lib.rs +++ b/gen/youtube3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *YouTube* crate version *0.1.8+20150414*, where *20150414* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *YouTube* crate version *0.1.8+20150529*, where *20150529* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. //! //! Everything else about the *YouTube* *v3* API can be found at the //! [official documentation site](https://developers.google.com/youtube/v3). @@ -157,16 +157,17 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.videos().list("part") -//! .video_category_id("erat") -//! .region_code("amet.") -//! .page_token("dolores") -//! .on_behalf_of_content_owner("dolores") -//! .my_rating("et") -//! .max_results(59) -//! .locale("et") +//! .video_category_id("dolores") +//! .region_code("et") +//! .page_token("sed") +//! .on_behalf_of_content_owner("et") +//! .my_rating("aliquyam") +//! .max_results(10) +//! .locale("sit") //! .id("aliquyam") -//! .hl("nonumy") -//! .chart("sit") +//! .hl("sadipscing") +//! .debug_project_id_override("magna") +//! .chart("gubergren") //! .doit(); //! //! match result { diff --git a/gen/youtube3/src/lib.rs.in b/gen/youtube3/src/lib.rs.in index 7fb102fd5e..74d5e17949 100644 --- a/gen/youtube3/src/lib.rs.in +++ b/gen/youtube3/src/lib.rs.in @@ -110,16 +110,17 @@ impl Default for Scope { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().list("part") -/// .video_category_id("labore") -/// .region_code("sea") -/// .page_token("nonumy") -/// .on_behalf_of_content_owner("dolores") -/// .my_rating("gubergren") -/// .max_results(6) -/// .locale("aliquyam") -/// .id("ea") -/// .hl("no") -/// .chart("justo") +/// .video_category_id("sea") +/// .region_code("nonumy") +/// .page_token("dolores") +/// .on_behalf_of_content_owner("gubergren") +/// .my_rating("sadipscing") +/// .max_results(70) +/// .locale("ea") +/// .id("no") +/// .hl("justo") +/// .debug_project_id_override("justo") +/// .chart("et") /// .doit(); /// /// match result { @@ -822,27 +823,43 @@ impl ToParts for PlaylistItem { } } -/// There is no detailed description. +/// A i18nRegion resource identifies a region where YouTube is available. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # 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 i18n regions](struct.I18nRegionListCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PlaylistItemContentDetails { - /// A user-generated note for this item. - pub note: Option, - /// The time, measured in seconds from the start of the video, when the video should start playing. (The playlist owner can specify the times when the video should start and stop playing when the video is played in the context of the playlist.) The default value is 0. - #[serde(rename="startAt")] - pub start_at: Option, - /// The time, measured in seconds from the start of the video, when the video should stop playing. (The playlist owner can specify the times when the video should start and stop playing when the video is played in the context of the playlist.) By default, assume that the video.endTime is the end of the video. - #[serde(rename="endAt")] - pub end_at: Option, - /// The ID that YouTube uses to uniquely identify a video. To retrieve the video resource, set the id query parameter to this value in your API request. - #[serde(rename="videoId")] - pub video_id: Option, +pub struct I18nRegion { + /// The snippet object contains basic details about the i18n region, such as region code and human-readable name. + pub snippet: Option, + /// Identifies what kind of resource this is. Value: the fixed string "youtube#i18nRegion". + pub kind: Option, + /// Etag of this resource. + pub etag: Option, + /// The ID that YouTube uses to uniquely identify the i18n region. + pub id: Option, } -impl Part for PlaylistItemContentDetails {} +impl Resource for I18nRegion {} +impl ToParts for I18nRegion { + /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. + /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or + /// the parts you want to see in the server response. + fn to_parts(&self) -> String { + let mut r = String::new(); + if self.snippet.is_some() { r = r + "snippet,"; } + if self.kind.is_some() { r = r + "kind,"; } + if self.etag.is_some() { r = r + "etag,"; } + if self.id.is_some() { r = r + "id,"; } + r.pop(); + r + } +} /// Internal representation of thumbnails for a YouTube resource. /// @@ -973,7 +990,7 @@ impl Part for ChannelConversionPings {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VideoAbuseReportSecondaryReason { /// The ID of this abuse report secondary reason. - pub id: Option, + pub id: Option, /// The localized label for this abuse report secondary reason. pub label: Option, } @@ -1223,18 +1240,21 @@ pub struct VideoSnippet { pub description: Option, /// A list of keyword tags associated with the video. Tags may contain spaces. This field is only visible to the video's uploader. pub tags: Option>, + /// The default_audio_language property specifies the language spoken in the video's default audio track. + #[serde(rename="defaultAudioLanguage")] + pub default_audio_language: Option, /// The ID that YouTube uses to uniquely identify the channel that the video was uploaded to. #[serde(rename="channelId")] pub channel_id: Option, - /// The language of the videos's default snippet. - #[serde(rename="defaultLanguage")] - pub default_language: Option, - /// Indicates if the video is an upcoming/active live broadcast. Or it's "none" if the video is not an upcoming/active live broadcast. - #[serde(rename="liveBroadcastContent")] - pub live_broadcast_content: Option, /// The date and time that the video was uploaded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. #[serde(rename="publishedAt")] pub published_at: Option, + /// Indicates if the video is an upcoming/active live broadcast. Or it's "none" if the video is not an upcoming/active live broadcast. + #[serde(rename="liveBroadcastContent")] + pub live_broadcast_content: Option, + /// The language of the videos's default snippet. + #[serde(rename="defaultLanguage")] + pub default_language: Option, /// A map of thumbnail images associated with the video. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail. pub thumbnails: Option, /// The video's title. @@ -1501,6 +1521,23 @@ pub struct ChannelLocalization { impl Part for ChannelLocalization {} +/// Statistics about the live broadcast. These represent a snapshot of the values at the time of the request. Statistics are only returned for live broadcasts. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LiveBroadcastStatistics { + /// The number of viewers currently watching the broadcast. The property and its value will be present if the broadcast has current viewers and the broadcast owner has not hidden the viewcount for the video. Note that YouTube stops tracking the number of concurrent viewers for a broadcast when the broadcast ends. So, this property would not identify the number of viewers watching an archived video of a live broadcast that already ended. + #[serde(rename="concurrentViewers")] + pub concurrent_viewers: Option, + /// The total number of live chat messages currently on the broadcast. The property and its value will be present if the broadcast is public, has the live chat feature enabled, and has at least one message. Note that this field will not be filled after the broadcast ends. So this property would not identify the number of chat messages for an archived video of a completed live broadcast. + #[serde(rename="totalChatCount")] + pub total_chat_count: Option, +} + +impl Part for LiveBroadcastStatistics {} + + /// A search result contains information about a YouTube video, channel, or playlist that matches the search parameters specified in an API request. While a search result points to a uniquely identifiable resource, like a video, it does not have its own persistent data. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1730,6 +1767,9 @@ impl ToParts for Subscription { /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LiveStreamSnippet { + /// no description provided + #[serde(rename="isDefaultStream")] + pub is_default_stream: Option, /// The ID that YouTube uses to uniquely identify the channel that is transmitting the stream. #[serde(rename="channelId")] pub channel_id: Option, @@ -1985,12 +2025,12 @@ impl ToParts for CaptionListResponse { /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LiveStreamStatus { - /// no description provided - #[serde(rename="isDefaultStream")] - pub is_default_stream: Option, /// no description provided #[serde(rename="streamStatus")] pub stream_status: Option, + /// The health status of the stream. + #[serde(rename="healthStatus")] + pub health_status: Option, } impl Part for LiveStreamStatus {} @@ -2014,7 +2054,7 @@ pub struct ContentRating { /// Rating system for Thailand - Board of Filmand Video Censors #[serde(rename="bfvcRating")] pub bfvc_rating: Option, - /// Rating system for Austria - Bundesministeriums f�r Unterricht, Kunst und Kultur! + /// Rating system for Austria - Bundesministerium f�r Unterricht, Kunst und Kultur #[serde(rename="bmukkRating")] pub bmukk_rating: Option, /// Rating system for Switzerland - Switzerland Rating System @@ -3394,43 +3434,27 @@ pub struct ActivityContentDetails { impl Part for ActivityContentDetails {} -/// A i18nRegion resource identifies a region where YouTube is available. +/// 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*). -/// -/// * [list i18n regions](struct.I18nRegionListCall.html) (none) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct I18nRegion { - /// The snippet object contains basic details about the i18n region, such as region code and human-readable name. - pub snippet: Option, - /// Identifies what kind of resource this is. Value: the fixed string "youtube#i18nRegion". - pub kind: Option, - /// Etag of this resource. - pub etag: Option, - /// The ID that YouTube uses to uniquely identify the i18n region. - pub id: Option, +pub struct PlaylistItemContentDetails { + /// A user-generated note for this item. + pub note: Option, + /// The time, measured in seconds from the start of the video, when the video should start playing. (The playlist owner can specify the times when the video should start and stop playing when the video is played in the context of the playlist.) The default value is 0. + #[serde(rename="startAt")] + pub start_at: Option, + /// The time, measured in seconds from the start of the video, when the video should stop playing. (The playlist owner can specify the times when the video should start and stop playing when the video is played in the context of the playlist.) By default, assume that the video.endTime is the end of the video. + #[serde(rename="endAt")] + pub end_at: Option, + /// The ID that YouTube uses to uniquely identify a video. To retrieve the video resource, set the id query parameter to this value in your API request. + #[serde(rename="videoId")] + pub video_id: Option, } -impl Resource for I18nRegion {} +impl Part for PlaylistItemContentDetails {} -impl ToParts for I18nRegion { - /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. - /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or - /// the parts you want to see in the server response. - fn to_parts(&self) -> String { - let mut r = String::new(); - if self.snippet.is_some() { r = r + "snippet,"; } - if self.kind.is_some() { r = r + "kind,"; } - if self.etag.is_some() { r = r + "etag,"; } - if self.id.is_some() { r = r + "id,"; } - r.pop(); - r - } -} /// The contentOwnerDetails object encapsulates channel data that is relevant for YouTube Partners linked with the channel. /// @@ -3464,9 +3488,6 @@ pub struct LiveBroadcastStatus { /// The broadcast's status. The status can be updated using the API's liveBroadcasts.transition method. #[serde(rename="lifeCycleStatus")] pub life_cycle_status: Option, - /// Whether or not this broadcast is the default broadcast - #[serde(rename="isDefaultBroadcast")] - pub is_default_broadcast: Option, /// Priority of the live broadcast event (internal state). #[serde(rename="liveBroadcastPriority")] pub live_broadcast_priority: Option, @@ -3475,19 +3496,6 @@ pub struct LiveBroadcastStatus { impl Part for LiveBroadcastStatus {} -/// 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 VideoAbuseReportReasonId { - /// no description provided - pub value: Option, -} - -impl Part for VideoAbuseReportReasonId {} - - /// Geographical coordinates of a point, in WGS84. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3941,15 +3949,20 @@ impl Part for ActivityContentDetailsSubscription {} pub struct LiveBroadcast { /// The status object contains information about the event's status. pub status: Option, - /// The snippet object contains basic details about the event, including its title, description, start time, and end time. - pub snippet: Option, + /// no description provided + #[serde(rename="topicDetails")] + pub topic_details: Option, /// Identifies what kind of resource this is. Value: the fixed string "youtube#liveBroadcast". pub kind: Option, - /// Etag of this resource. - pub etag: Option, + /// The statistics object contains info about the event's current stats. These include concurrent viewers and total chat count. Statistics can change (in either direction) during the lifetime of an event. Statistics are only returned while the event is live. + pub statistics: Option, /// The contentDetails object contains information about the event's video content, such as whether the content can be shown in an embedded video player or if it will be archived and therefore available for viewing after the event has concluded. #[serde(rename="contentDetails")] pub content_details: Option, + /// The snippet object contains basic details about the event, including its title, description, start time, and end time. + pub snippet: Option, + /// Etag of this resource. + pub etag: Option, /// The ID that YouTube assigns to uniquely identify the broadcast. pub id: Option, } @@ -3965,16 +3978,38 @@ impl ToParts for LiveBroadcast { fn to_parts(&self) -> String { let mut r = String::new(); if self.status.is_some() { r = r + "status,"; } - if self.snippet.is_some() { r = r + "snippet,"; } + if self.topic_details.is_some() { r = r + "topicDetails,"; } if self.kind.is_some() { r = r + "kind,"; } - if self.etag.is_some() { r = r + "etag,"; } + if self.statistics.is_some() { r = r + "statistics,"; } if self.content_details.is_some() { r = r + "contentDetails,"; } + if self.snippet.is_some() { r = r + "snippet,"; } + if self.etag.is_some() { r = r + "etag,"; } if self.id.is_some() { r = r + "id,"; } r.pop(); r } } +/// 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 LiveStreamConfigurationIssue { + /// The short-form reason for this issue. + pub reason: Option, + /// The kind of error happening. + #[serde(rename="type")] + pub type_: Option, + /// The long-form description of the issue and how to resolve it. + pub description: Option, + /// How severe this issue is to the stream. + pub severity: Option, +} + +impl Part for LiveStreamConfigurationIssue {} + + /// Statistics about a channel: number of subscribers, number of videos in the channel, etc. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4157,6 +4192,19 @@ pub struct PlaylistStatus { impl Part for PlaylistStatus {} +/// 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 LiveBroadcastTopicDetails { + /// no description provided + pub topics: Option>, +} + +impl Part for LiveBroadcastTopicDetails {} + + /// Settings and Info of the monitor stream /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4224,6 +4272,25 @@ pub struct VideoTopicDetails { impl Part for VideoTopicDetails {} +/// 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 LiveStreamHealthStatus { + /// The status code of this stream + pub status: Option, + /// The configurations issues on this stream + #[serde(rename="configurationIssues")] + pub configuration_issues: Option>, + /// The last time this status was updated (in seconds) + #[serde(rename="lastUpdateTimeS")] + pub last_update_time_s: Option, +} + +impl Part for LiveStreamHealthStatus {} + + /// A videoAbuseReportReason resource identifies a reason that a video could be reported as abusive. Video abuse report reasons are used with video.ReportAbuse. /// /// # Activities @@ -4474,6 +4541,9 @@ pub struct LiveBroadcastSnippet { /// The date and time that the broadcast is scheduled to end. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. #[serde(rename="scheduledEndTime")] pub scheduled_end_time: Option, + /// no description provided + #[serde(rename="isDefaultBroadcast")] + pub is_default_broadcast: Option, /// A map of thumbnail images associated with the broadcast. For each nested object in this object, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail. pub thumbnails: Option, } @@ -4516,9 +4586,9 @@ impl Part for CommentThreadSnippet {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LiveBroadcastContentDetails { - /// This setting indicates whether the broadcast should automatically begin with an in-stream slate when you update the broadcast's status to live. After updating the status, you then need to send a liveCuepoints.insert request that sets the cuepoint's eventState to end to remove the in-stream slate and make your broadcast stream visible to viewers. - #[serde(rename="startWithSlate")] - pub start_with_slate: Option, + /// no description provided + #[serde(rename="enableLowLatency")] + pub enable_low_latency: Option, /// This value uniquely identifies the live stream bound to the broadcast. #[serde(rename="boundStreamId")] pub bound_stream_id: Option, @@ -4528,6 +4598,9 @@ pub struct LiveBroadcastContentDetails { /// This setting indicates whether closed captioning is enabled for this broadcast. The ingestion URL of the closed captions is returned through the liveStreams API. #[serde(rename="enableClosedCaptions")] pub enable_closed_captions: Option, + /// The monitorStream object contains information about the monitor stream, which the broadcaster can use to review the event content before the broadcast stream is shown publicly. + #[serde(rename="monitorStream")] + pub monitor_stream: Option, /// This setting indicates whether YouTube should enable content encryption for the broadcast. #[serde(rename="enableContentEncryption")] pub enable_content_encryption: Option, @@ -4545,9 +4618,9 @@ pub struct LiveBroadcastContentDetails { /// Important: You must set the value to true and also set the enableArchive property's value to true if you want to make playback available immediately after the broadcast ends. #[serde(rename="enableDvr")] pub enable_dvr: Option, - /// The monitorStream object contains information about the monitor stream, which the broadcaster can use to review the event content before the broadcast stream is shown publicly. - #[serde(rename="monitorStream")] - pub monitor_stream: Option, + /// This setting indicates whether the broadcast should automatically begin with an in-stream slate when you update the broadcast's status to live. After updating the status, you then need to send a liveCuepoints.insert request that sets the cuepoint's eventState to end to remove the in-stream slate and make your broadcast stream visible to viewers. + #[serde(rename="startWithSlate")] + pub start_with_slate: Option, } impl Part for LiveBroadcastContentDetails {} @@ -4701,6 +4774,40 @@ pub struct SearchResultSnippet { impl Part for SearchResultSnippet {} +/// 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 LiveBroadcastTopicSnippet { + /// The date at which the topic was released. Filled for types: videoGame + #[serde(rename="releaseDate")] + pub release_date: Option, + /// The name of the topic. + pub name: Option, +} + +impl Part for LiveBroadcastTopicSnippet {} + + +/// 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 LiveBroadcastTopic { + /// Information about the topic matched. + pub snippet: Option, + /// The type of the topic. + #[serde(rename="type")] + pub type_: Option, + /// If this flag is set it means that we have not been able to match the topic title and type provided to a known entity. + pub unmatched: Option, +} + +impl Part for LiveBroadcastTopic {} + + // ################### // MethodBuilders ### @@ -4746,11 +4853,11 @@ impl<'a, C, A> I18nLanguageMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of supported languages. + /// Returns a list of application languages that the YouTube website supports. /// /// # Arguments /// - /// * `part` - The part parameter specifies a comma-separated list of one or more i18nLanguage resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet. + /// * `part` - The part parameter specifies the i18nLanguage resource properties that the API response will include. Set the parameter value to snippet. pub fn list(&self, part: &str) -> I18nLanguageListCall<'a, C, A> { I18nLanguageListCall { hub: self.hub, @@ -4995,8 +5102,7 @@ impl<'a, C, A> GuideCategoryMethods<'a, C, A> { /// /// # Arguments /// - /// * `part` - The part parameter specifies a comma-separated list of one or more guideCategory resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet. - /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a guideCategory resource, the snippet property contains other properties, such as the category's title. If you set part=snippet, the API response will also contain all of those nested properties. + /// * `part` - The part parameter specifies the guideCategory resource properties that the API response will include. Set the parameter value to snippet. pub fn list(&self, part: &str) -> GuideCategoryListCall<'a, C, A> { GuideCategoryListCall { hub: self.hub, @@ -5078,7 +5184,7 @@ impl<'a, C, A> PlaylistMethods<'a, C, A> { /// /// # Arguments /// - /// * `part` - The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, status, and contentDetails. + /// * `part` - The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include. /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties. pub fn list(&self, part: &str) -> PlaylistListCall<'a, C, A> { PlaylistListCall { @@ -5260,7 +5366,7 @@ impl<'a, C, A> VideoMethods<'a, C, A> { /// /// # Arguments /// - /// * `part` - The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, fileDetails, liveStreamingDetails, localizations, player, processingDetails, recordingDetails, statistics, status, suggestions, and topicDetails. + /// * `part` - The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties. pub fn list(&self, part: &str) -> VideoListCall<'a, C, A> { VideoListCall { @@ -5275,6 +5381,7 @@ impl<'a, C, A> VideoMethods<'a, C, A> { _locale: Default::default(), _id: Default::default(), _hl: Default::default(), + _debug_project_id_override: Default::default(), _chart: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -5295,7 +5402,6 @@ impl<'a, C, A> VideoMethods<'a, C, A> { hub: self.hub, _id: id.to_string(), _rating: rating.to_string(), - _on_behalf_of_content_owner: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5448,7 +5554,7 @@ impl<'a, C, A> SubscriptionMethods<'a, C, A> { /// /// # Arguments /// - /// * `part` - The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails. + /// * `part` - The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties. pub fn list(&self, part: &str) -> SubscriptionListCall<'a, C, A> { SubscriptionListCall { @@ -5534,8 +5640,7 @@ impl<'a, C, A> SearchMethods<'a, C, A> { /// /// # Arguments /// - /// * `part` - The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet. - /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a search result, the snippet property contains other properties that identify the result's title, description, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. + /// * `part` - The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. Set the parameter value to snippet. pub fn list(&self, part: &str) -> SearchListCall<'a, C, A> { SearchListCall { hub: self.hub, @@ -5619,11 +5724,11 @@ impl<'a, C, A> I18nRegionMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of supported regions. + /// Returns a list of content regions that the YouTube website supports. /// /// # Arguments /// - /// * `part` - The part parameter specifies a comma-separated list of one or more i18nRegion resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet. + /// * `part` - The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet. pub fn list(&self, part: &str) -> I18nRegionListCall<'a, C, A> { I18nRegionListCall { hub: self.hub, @@ -5682,7 +5787,7 @@ impl<'a, C, A> CommentThreadMethods<'a, C, A> { /// /// # Arguments /// - /// * `part` - The part parameter specifies the commentThread resource parts that the API response will include. Supported values are id, snippet and replies. + /// * `part` - The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include. pub fn list(&self, part: &str) -> CommentThreadListCall<'a, C, A> { CommentThreadListCall { hub: self.hub, @@ -5691,6 +5796,7 @@ impl<'a, C, A> CommentThreadMethods<'a, C, A> { _text_format: Default::default(), _search_terms: Default::default(), _page_token: Default::default(), + _order: Default::default(), _moderation_status: Default::default(), _max_results: Default::default(), _id: Default::default(), @@ -5704,7 +5810,7 @@ impl<'a, C, A> CommentThreadMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Modifies an existing comment. + /// Modifies the top-level comment in a comment thread. /// /// # Arguments /// @@ -5723,7 +5829,7 @@ impl<'a, C, A> CommentThreadMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new comment thread and top level comment. + /// Creates a new top-level comment. To add a reply to an existing comment, use the comments.insert method instead. /// /// # Arguments /// @@ -5909,9 +6015,7 @@ impl<'a, C, A> CommentMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new comment. - /// - /// Note: to create a top level comment it is also necessary to create a comment thread. Both are accomplished through the commentThreads resource. + /// Creates a reply to an existing comment. Note: To create a top-level comment, use the commentThreads.insert method. /// /// # Arguments /// @@ -5930,12 +6034,12 @@ impl<'a, C, A> CommentMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the moderation status of one or more comments. + /// Sets the moderation status of one or more comments. The API request must be authorized by the owner of the channel or video associated with the comments. /// /// # Arguments /// - /// * `id` - The id parameter specifies a comma-separated list of IDs of comments whose moderation status should be updated. - /// * `moderationStatus` - Determines the new moderation status of the specified comments. + /// * `id` - The id parameter specifies a comma-separated list of IDs that identify the comments for which you are updating the moderation status. + /// * `moderationStatus` - Identifies the new moderation status of the specified comments. pub fn set_moderation_status(&self, id: &str, moderation_status: &str) -> CommentSetModerationStatuCall<'a, C, A> { CommentSetModerationStatuCall { hub: self.hub, @@ -5954,7 +6058,7 @@ impl<'a, C, A> CommentMethods<'a, C, A> { /// /// # Arguments /// - /// * `id` - The id parameter specifies the comment ID for the resource that should be deleted. + /// * `id` - The id parameter specifies the comment ID for the resource that is being deleted. pub fn delete(&self, id: &str) -> CommentDeleteCall<'a, C, A> { CommentDeleteCall { hub: self.hub, @@ -5971,7 +6075,7 @@ impl<'a, C, A> CommentMethods<'a, C, A> { /// /// # Arguments /// - /// * `part` - The part parameter specifies the comment resource parts that the API response will include. Supported values are id and snippet. + /// * `part` - The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include. pub fn list(&self, part: &str) -> CommentListCall<'a, C, A> { CommentListCall { hub: self.hub, @@ -5989,7 +6093,7 @@ impl<'a, C, A> CommentMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Modifies an existing comment. + /// Modifies a comment. /// /// # Arguments /// @@ -6008,11 +6112,11 @@ impl<'a, C, A> CommentMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Expresses the caller's opinion that a comment is spam. + /// Expresses the caller's opinion that one or more comments should be flagged as spam. /// /// # Arguments /// - /// * `id` - The id parameter specifies a comma-separated list of IDs of comments which should get flagged as spam. + /// * `id` - The id parameter specifies a comma-separated list of IDs of comments that the caller believes should be classified as spam. pub fn mark_as_spam(&self, id: &str) -> CommentMarkAsSpamCall<'a, C, A> { CommentMarkAsSpamCall { hub: self.hub, @@ -6066,7 +6170,7 @@ impl<'a, C, A> ChannelMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a channel's metadata. + /// Updates a channel's metadata. Note that this method currently only supports updates to the channel resource's brandingSettings and invideoPromotion objects and their child properties. /// /// # Arguments /// @@ -6090,7 +6194,7 @@ impl<'a, C, A> ChannelMethods<'a, C, A> { /// /// # Arguments /// - /// * `part` - The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, statistics, topicDetails, and invideoPromotion. + /// * `part` - The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include. /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties. pub fn list(&self, part: &str) -> ChannelListCall<'a, C, A> { ChannelListCall { @@ -6255,7 +6359,7 @@ impl<'a, C, A> PlaylistItemMethods<'a, C, A> { /// /// # Arguments /// - /// * `part` - The part parameter specifies a comma-separated list of one or more playlistItem 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. + /// * `part` - The part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include. /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties. pub fn list(&self, part: &str) -> PlaylistItemListCall<'a, C, A> { PlaylistItemListCall { @@ -6340,7 +6444,7 @@ impl<'a, C, A> WatermarkMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `channelId` - The channelId parameter specifies a YouTube channel ID for which the watermark is being provided. + /// * `channelId` - The channelId parameter specifies the YouTube channel ID for which the watermark is being provided. pub fn set(&self, request: InvideoBranding, channel_id: &str) -> WatermarkSetCall<'a, C, A> { WatermarkSetCall { hub: self.hub, @@ -6355,11 +6459,11 @@ impl<'a, C, A> WatermarkMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a watermark. + /// Deletes a channel's watermark image. /// /// # Arguments /// - /// * `channelId` - The channelId parameter specifies a YouTube channel ID for which the watermark is being unset. + /// * `channelId` - The channelId parameter specifies the YouTube channel ID for which the watermark is being unset. pub fn unset(&self, channel_id: &str) -> WatermarkUnsetCall<'a, C, A> { WatermarkUnsetCall { hub: self.hub, @@ -6546,7 +6650,7 @@ impl<'a, C, A> LiveBroadcastMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// 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. + /// 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. /// /// # Arguments /// @@ -6618,6 +6722,7 @@ impl<'a, C, A> CaptionMethods<'a, C, A> { CaptionDeleteCall { hub: self.hub, _id: id.to_string(), + _on_behalf_of_content_owner: Default::default(), _on_behalf_of: Default::default(), _debug_project_id_override: Default::default(), _delegate: Default::default(), @@ -6640,6 +6745,7 @@ impl<'a, C, A> CaptionMethods<'a, C, A> { _request: request, _part: parts, _sync: Default::default(), + _on_behalf_of_content_owner: Default::default(), _on_behalf_of: Default::default(), _debug_project_id_override: Default::default(), _delegate: Default::default(), @@ -6661,6 +6767,7 @@ impl<'a, C, A> CaptionMethods<'a, C, A> { hub: self.hub, _part: part.to_string(), _video_id: video_id.to_string(), + _on_behalf_of_content_owner: Default::default(), _on_behalf_of: Default::default(), _id: Default::default(), _debug_project_id_override: Default::default(), @@ -6683,6 +6790,7 @@ impl<'a, C, A> CaptionMethods<'a, C, A> { _id: id.to_string(), _tlang: Default::default(), _tfmt: Default::default(), + _on_behalf_of_content_owner: Default::default(), _on_behalf_of: Default::default(), _debug_project_id_override: Default::default(), _delegate: Default::default(), @@ -6705,6 +6813,7 @@ impl<'a, C, A> CaptionMethods<'a, C, A> { _request: request, _part: parts, _sync: Default::default(), + _on_behalf_of_content_owner: Default::default(), _on_behalf_of: Default::default(), _debug_project_id_override: Default::default(), _delegate: Default::default(), @@ -6760,7 +6869,7 @@ impl<'a, C, A> VideoCategoryMethods<'a, C, A> { /// /// # Arguments /// - /// * `part` - The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet. + /// * `part` - The part parameter specifies the videoCategory resource properties that the API response will include. Set the parameter value to snippet. pub fn list(&self, part: &str) -> VideoCategoryListCall<'a, C, A> { VideoCategoryListCall { hub: self.hub, @@ -6821,8 +6930,8 @@ impl<'a, C, A> ActivityMethods<'a, C, A> { /// /// # Arguments /// - /// * `part` - The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails. - /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. + /// * `part` - The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. + /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. pub fn list(&self, part: &str) -> ActivityListCall<'a, C, A> { ActivityListCall { hub: self.hub, @@ -6871,27 +6980,11 @@ impl<'a, C, A> ActivityMethods<'a, C, A> { // CallBuilders ### // ################# -/// Returns a list of supported languages. +/// Returns a list of application languages that the YouTube website supports. /// /// A builder for the *list* method supported by a *i18nLanguage* resource. /// It is not used directly, but through a `I18nLanguageMethods` instance. /// -/// **Settable Parts** -/// -/// * *id* -/// * *snippet* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtube.readonly* -/// * *https://www.googleapis.com/auth/youtubepartner* -/// -/// The default scope will be `Scope::Readonly`. -/// /// # Example /// /// Instantiate a resource method builder @@ -6914,7 +7007,7 @@ impl<'a, C, A> ActivityMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.i18n_languages().list("part") -/// .hl("et") +/// .hl("diam") /// .doit(); /// # } /// ``` @@ -7045,17 +7138,12 @@ impl<'a, C, A> I18nLanguageListCall<'a, C, A> where C: BorrowMut, } - /// The part parameter specifies a comma-separated list of one or more i18nLanguage resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet. + /// The part parameter specifies the i18nLanguage resource properties that the API response will include. Set the parameter value to snippet. /// /// Sets the *part* query property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* pub fn part(mut self, new_value: &str) -> I18nLanguageListCall<'a, C, A> { self._part = new_value.to_string(); self @@ -7157,7 +7245,7 @@ impl<'a, C, A> I18nLanguageListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.channel_banners().insert(req) -/// .on_behalf_of_content_owner("et") +/// .on_behalf_of_content_owner("ipsum") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -7532,11 +7620,11 @@ impl<'a, C, A> ChannelBannerInsertCall<'a, C, A> where C: BorrowMut ChannelSectionListCall<'a, C, A> where C: BorrowMut ChannelSectionInsertCall<'a, C, A> where C: BorrowMut ChannelSectionDeleteCall<'a, C, A> where C: BorrowMut ChannelSectionUpdateCall<'a, C, A> where C: BorrowMut ChannelSectionUpdateCall<'a, C, A> where C: BorrowMut GuideCategoryListCall<'a, C, A> where C: BorrowMut } - /// The part parameter specifies a comma-separated list of one or more guideCategory resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet. - /// - /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a guideCategory resource, the snippet property contains other properties, such as the category's title. If you set part=snippet, the API response will also contain all of those nested properties. + /// The part parameter specifies the guideCategory resource properties that the API response will include. Set the parameter value to snippet. /// /// Sets the *part* query property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* pub fn part(mut self, new_value: &str) -> GuideCategoryListCall<'a, C, A> { self._part = new_value.to_string(); self @@ -8893,21 +8958,6 @@ impl<'a, C, A> GuideCategoryListCall<'a, C, A> where C: BorrowMut /// A builder for the *insert* method supported by a *playlist* resource. /// It is not used directly, but through a `PlaylistMethods` instance. /// -/// **Settable Parts** -/// -/// * *snippet* -/// * *status* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtubepartner* -/// -/// The default scope will be `Scope::Full`. -/// /// # Example /// /// Instantiate a resource method builder @@ -8931,15 +8981,13 @@ impl<'a, C, A> GuideCategoryListCall<'a, C, A> where C: BorrowMut /// // 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 = Playlist::default(); -/// req.status = Default::default(); // is PlaylistStatus -/// req.snippet = Default::default(); // is PlaylistSnippet /// /// // 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.playlists().insert(req) -/// .on_behalf_of_content_owner_channel("no") -/// .on_behalf_of_content_owner("labore") +/// .on_behalf_of_content_owner_channel("eirmod") +/// .on_behalf_of_content_owner("dolore") /// .doit(); /// # } /// ``` @@ -9098,18 +9146,11 @@ impl<'a, C, A> PlaylistInsertCall<'a, C, A> where C: BorrowMut, A /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *snippet* - /// * *status* pub fn request(mut self, new_value: Playlist) -> PlaylistInsertCall<'a, C, A> { self._request = new_value; self } /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. - /// - /// The part names that you can include in the parameter value are snippet and status. /// /// Sets the *part* query property to the given value. /// @@ -9118,11 +9159,6 @@ impl<'a, C, A> PlaylistInsertCall<'a, C, A> where C: BorrowMut, A /// This may not always be desirable, as you can obtain (newly generated) parts you cannot pass in, /// like statistics that are generated server side. Therefore you should use this method to specify /// the parts you provide in addition to the ones you want in the response. - /// - /// **Settable Parts** - /// - /// * *snippet* - /// * *status* pub fn part(mut self, new_value: &str) -> PlaylistInsertCall<'a, C, A> { self._part = new_value.to_string(); self @@ -9204,24 +9240,6 @@ impl<'a, C, A> PlaylistInsertCall<'a, C, A> where C: BorrowMut, A /// A builder for the *list* method supported by a *playlist* resource. /// It is not used directly, but through a `PlaylistMethods` instance. /// -/// **Settable Parts** -/// -/// * *id* -/// * *snippet* -/// * *status* -/// * *contentDetails* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtube.readonly* -/// * *https://www.googleapis.com/auth/youtubepartner* -/// -/// The default scope will be `Scope::Readonly`. -/// /// # Example /// /// Instantiate a resource method builder @@ -9244,14 +9262,14 @@ impl<'a, C, A> PlaylistInsertCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.playlists().list("part") -/// .page_token("dolore") -/// .on_behalf_of_content_owner_channel("invidunt") -/// .on_behalf_of_content_owner("aliquyam") -/// .mine(false) -/// .max_results(45) -/// .id("sea") +/// .page_token("aliquyam") +/// .on_behalf_of_content_owner_channel("accusam") +/// .on_behalf_of_content_owner("Lorem") +/// .mine(true) +/// .max_results(80) +/// .id("duo") /// .hl("et") -/// .channel_id("duo") +/// .channel_id("eirmod") /// .doit(); /// # } /// ``` @@ -9410,7 +9428,7 @@ impl<'a, C, A> PlaylistListCall<'a, C, A> where C: BorrowMut, A: } - /// The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, status, and contentDetails. + /// The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include. /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties. /// @@ -9418,13 +9436,6 @@ impl<'a, C, A> PlaylistListCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* - /// * *status* - /// * *contentDetails* pub fn part(mut self, new_value: &str) -> PlaylistListCall<'a, C, A> { self._part = new_value.to_string(); self @@ -9570,7 +9581,7 @@ impl<'a, C, A> PlaylistListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.playlists().delete("id") -/// .on_behalf_of_content_owner("eirmod") +/// .on_behalf_of_content_owner("et") /// .doit(); /// # } /// ``` @@ -9766,21 +9777,6 @@ impl<'a, C, A> PlaylistDeleteCall<'a, C, A> where C: BorrowMut, A /// A builder for the *update* method supported by a *playlist* resource. /// It is not used directly, but through a `PlaylistMethods` instance. /// -/// **Settable Parts** -/// -/// * *snippet* -/// * *status* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtubepartner* -/// -/// The default scope will be `Scope::Full`. -/// /// # Example /// /// Instantiate a resource method builder @@ -9804,14 +9800,12 @@ impl<'a, C, A> PlaylistDeleteCall<'a, C, A> where C: BorrowMut, A /// // 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 = Playlist::default(); -/// req.status = Default::default(); // is PlaylistStatus -/// req.snippet = Default::default(); // is PlaylistSnippet /// /// // 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.playlists().update(req) -/// .on_behalf_of_content_owner("sanctus") +/// .on_behalf_of_content_owner("amet") /// .doit(); /// # } /// ``` @@ -9966,20 +9960,13 @@ impl<'a, C, A> PlaylistUpdateCall<'a, C, A> where C: BorrowMut, A /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *snippet* - /// * *status* pub fn request(mut self, new_value: Playlist) -> PlaylistUpdateCall<'a, C, A> { self._request = new_value; self } /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. /// - /// The part names that you can include in the parameter value are snippet and status. - /// - /// Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist's privacy setting is contained in the status part. As such, if your request is updating a private playlist, and the request's part parameter value includes the status part, the playlist's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the playlist will revert to the default privacy setting. + /// Note that this method will override the existing values for mutable properties that are contained in any parts that the request body specifies. For example, a playlist's description is contained in the snippet part, which must be included in the request body. If the request does not specify a value for the snippet.description property, the playlist's existing description will be deleted. /// /// Sets the *part* query property to the given value. /// @@ -9988,11 +9975,6 @@ impl<'a, C, A> PlaylistUpdateCall<'a, C, A> where C: BorrowMut, A /// This may not always be desirable, as you can obtain (newly generated) parts you cannot pass in, /// like statistics that are generated server side. Therefore you should use this method to specify /// the parts you provide in addition to the ones you want in the response. - /// - /// **Settable Parts** - /// - /// * *snippet* - /// * *status* pub fn part(mut self, new_value: &str) -> PlaylistUpdateCall<'a, C, A> { self._part = new_value.to_string(); self @@ -10086,7 +10068,7 @@ impl<'a, C, A> PlaylistUpdateCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.thumbnails().set("videoId") -/// .on_behalf_of_content_owner("amet") +/// .on_behalf_of_content_owner("consetetur") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -10338,7 +10320,9 @@ impl<'a, C, A> ThumbnailSetCall<'a, C, A> where C: BorrowMut, A: self._video_id = new_value.to_string(); self } - /// The onBehalfOfContentOwner parameter indicates that the authenticated user 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 actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner. + /// Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The 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 actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. /// /// Sets the *on behalf of content owner* query property to the given value. pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> ThumbnailSetCall<'a, C, A> { @@ -10430,7 +10414,7 @@ impl<'a, C, A> ThumbnailSetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().report_abuse(req) -/// .on_behalf_of_content_owner("et") +/// .on_behalf_of_content_owner("ut") /// .doit(); /// # } /// ``` @@ -10639,33 +10623,6 @@ impl<'a, C, A> VideoReportAbuseCall<'a, C, A> where C: BorrowMut, /// A builder for the *list* method supported by a *video* resource. /// It is not used directly, but through a `VideoMethods` instance. /// -/// **Settable Parts** -/// -/// * *id* -/// * *snippet* -/// * *contentDetails* -/// * *fileDetails* -/// * *liveStreamingDetails* -/// * *localizations* -/// * *player* -/// * *processingDetails* -/// * *recordingDetails* -/// * *statistics* -/// * *status* -/// * *suggestions* -/// * *topicDetails* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtube.readonly* -/// * *https://www.googleapis.com/auth/youtubepartner* -/// -/// The default scope will be `Scope::Readonly`. -/// /// # Example /// /// Instantiate a resource method builder @@ -10688,16 +10645,17 @@ impl<'a, C, A> VideoReportAbuseCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().list("part") -/// .video_category_id("ut") -/// .region_code("ea") -/// .page_token("sed") +/// .video_category_id("sed") +/// .region_code("dolor") +/// .page_token("dolor") /// .on_behalf_of_content_owner("dolor") -/// .my_rating("dolor") -/// .max_results(53) -/// .locale("et") -/// .id("consetetur") -/// .hl("amet.") -/// .chart("voluptua.") +/// .my_rating("et") +/// .max_results(5) +/// .locale("amet.") +/// .id("voluptua.") +/// .hl("Lorem") +/// .debug_project_id_override("gubergren") +/// .chart("justo") /// .doit(); /// # } /// ``` @@ -10715,6 +10673,7 @@ pub struct VideoListCall<'a, C, A> _locale: Option, _id: Option, _hl: Option, + _debug_project_id_override: Option, _chart: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -10737,7 +10696,7 @@ impl<'a, C, A> VideoListCall<'a, C, A> where C: BorrowMut, A: oau }; dlg.begin(MethodInfo { id: "youtube.videos.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((13 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((14 + self._additional_params.len())); params.push(("part", self._part.to_string())); if let Some(value) = self._video_category_id { params.push(("videoCategoryId", value.to_string())); @@ -10766,10 +10725,13 @@ impl<'a, C, A> VideoListCall<'a, C, A> where C: BorrowMut, A: oau if let Some(value) = self._hl { params.push(("hl", value.to_string())); } + if let Some(value) = self._debug_project_id_override { + params.push(("debugProjectIdOverride", value.to_string())); + } if let Some(value) = self._chart { params.push(("chart", value.to_string())); } - for &field in ["alt", "part", "videoCategoryId", "regionCode", "pageToken", "onBehalfOfContentOwner", "myRating", "maxResults", "locale", "id", "hl", "chart"].iter() { + for &field in ["alt", "part", "videoCategoryId", "regionCode", "pageToken", "onBehalfOfContentOwner", "myRating", "maxResults", "locale", "id", "hl", "debugProjectIdOverride", "chart"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10864,7 +10826,7 @@ impl<'a, C, A> VideoListCall<'a, C, A> where C: BorrowMut, A: oau } - /// The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, fileDetails, liveStreamingDetails, localizations, player, processingDetails, recordingDetails, statistics, status, suggestions, and topicDetails. + /// The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties. /// @@ -10872,22 +10834,6 @@ impl<'a, C, A> VideoListCall<'a, C, A> where C: BorrowMut, A: oau /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* - /// * *contentDetails* - /// * *fileDetails* - /// * *liveStreamingDetails* - /// * *localizations* - /// * *player* - /// * *processingDetails* - /// * *recordingDetails* - /// * *statistics* - /// * *status* - /// * *suggestions* - /// * *topicDetails* pub fn part(mut self, new_value: &str) -> VideoListCall<'a, C, A> { self._part = new_value.to_string(); self @@ -10954,13 +10900,22 @@ impl<'a, C, A> VideoListCall<'a, C, A> where C: BorrowMut, A: oau self._id = Some(new_value.to_string()); self } - /// The hl parameter instructs the API to return a localized version of the video details. If localized text is nor available for the requested language, the localizations object in the API response will contain the requested information in the default language instead. The parameter value is a BCP-47 language code. Your application can determine whether the requested localization was returned by checking the value of the snippet.localized.language property in the API response. + /// The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. + /// + /// If localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language. /// /// Sets the *hl* query property to the given value. pub fn hl(mut self, new_value: &str) -> VideoListCall<'a, C, A> { self._hl = Some(new_value.to_string()); self } + /// The debugProjectIdOverride parameter should be used for mimicking a request for a certain project ID + /// + /// Sets the *debug project id override* query property to the given value. + pub fn debug_project_id_override(mut self, new_value: &str) -> VideoListCall<'a, C, A> { + self._debug_project_id_override = Some(new_value.to_string()); + self + } /// The chart parameter identifies the chart that you want to retrieve. /// /// Sets the *chart* query property to the given value. @@ -11047,7 +11002,6 @@ impl<'a, C, A> VideoListCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().rate("id", "rating") -/// .on_behalf_of_content_owner("justo") /// .doit(); /// # } /// ``` @@ -11057,7 +11011,6 @@ pub struct VideoRateCall<'a, C, A> hub: &'a YouTube, _id: String, _rating: String, - _on_behalf_of_content_owner: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -11079,13 +11032,10 @@ impl<'a, C, A> VideoRateCall<'a, C, A> where C: BorrowMut, A: oau }; dlg.begin(MethodInfo { id: "youtube.videos.rate", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); params.push(("id", self._id.to_string())); params.push(("rating", self._rating.to_string())); - if let Some(value) = self._on_behalf_of_content_owner { - params.push(("onBehalfOfContentOwner", value.to_string())); - } - for &field in ["id", "rating", "onBehalfOfContentOwner"].iter() { + for &field in ["id", "rating"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11189,15 +11139,6 @@ impl<'a, C, A> VideoRateCall<'a, C, A> where C: BorrowMut, A: oau self._rating = new_value.to_string(); self } - /// Note: This parameter is intended exclusively for YouTube content partners. - /// - /// The 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. - /// - /// Sets the *on behalf of content owner* query property to the given value. - pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> VideoRateCall<'a, C, A> { - self._on_behalf_of_content_owner = 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. /// @@ -11277,7 +11218,7 @@ impl<'a, C, A> VideoRateCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().get_rating("id") -/// .on_behalf_of_content_owner("vero") +/// .on_behalf_of_content_owner("rebum.") /// .doit(); /// # } /// ``` @@ -11506,7 +11447,7 @@ impl<'a, C, A> VideoGetRatingCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().delete("id") -/// .on_behalf_of_content_owner("rebum.") +/// .on_behalf_of_content_owner("sadipscing") /// .doit(); /// # } /// ``` @@ -11702,31 +11643,6 @@ impl<'a, C, A> VideoDeleteCall<'a, C, A> where C: BorrowMut, A: o /// A builder for the *update* method supported by a *video* resource. /// It is not used directly, but through a `VideoMethods` instance. /// -/// **Settable Parts** -/// -/// * *snippet* -/// * *contentDetails* -/// * *fileDetails* -/// * *liveStreamingDetails* -/// * *localizations* -/// * *player* -/// * *processingDetails* -/// * *recordingDetails* -/// * *statistics* -/// * *status* -/// * *suggestions* -/// * *topicDetails* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtubepartner* -/// -/// The default scope will be `Scope::Full`. -/// /// # Example /// /// Instantiate a resource method builder @@ -11750,24 +11666,12 @@ impl<'a, C, A> VideoDeleteCall<'a, C, A> where C: BorrowMut, A: o /// // 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 = Video::default(); -/// req.status = Default::default(); // is VideoStatus -/// req.topic_details = Default::default(); // is VideoTopicDetails -/// req.suggestions = Default::default(); // is VideoSuggestions -/// req.file_details = Default::default(); // is VideoFileDetails -/// req.player = Default::default(); // is VideoPlayer -/// req.localizations = Default::default(); // is HashMap -/// req.live_streaming_details = Default::default(); // is VideoLiveStreamingDetails -/// req.snippet = Default::default(); // is VideoSnippet -/// req.statistics = Default::default(); // is VideoStatistics -/// req.processing_details = Default::default(); // is VideoProcessingDetails -/// req.content_details = Default::default(); // is VideoContentDetails -/// req.recording_details = Default::default(); // is VideoRecordingDetails /// /// // 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.videos().update(req) -/// .on_behalf_of_content_owner("consetetur") +/// .on_behalf_of_content_owner("vero") /// .doit(); /// # } /// ``` @@ -11922,32 +11826,15 @@ impl<'a, C, A> VideoUpdateCall<'a, C, A> where C: BorrowMut, A: o /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *snippet* - /// * *contentDetails* - /// * *fileDetails* - /// * *liveStreamingDetails* - /// * *localizations* - /// * *player* - /// * *processingDetails* - /// * *recordingDetails* - /// * *statistics* - /// * *status* - /// * *suggestions* - /// * *topicDetails* pub fn request(mut self, new_value: Video) -> VideoUpdateCall<'a, C, A> { self._request = new_value; self } /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. /// - /// The part names that you can include in the parameter value are snippet, contentDetails, fileDetails, liveStreamingDetails, localizations, player, processingDetails, recordingDetails, statistics, status, suggestions, and topicDetails. - /// /// Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a video's privacy setting is contained in the status part. As such, if your request is updating a private video, and the request's part parameter value includes the status part, the video's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the video will revert to the default privacy setting. /// - /// In addition, not all of those parts contain properties that can be set when setting or updating a video's metadata. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response. + /// In addition, not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response. /// /// Sets the *part* query property to the given value. /// @@ -11956,21 +11843,6 @@ impl<'a, C, A> VideoUpdateCall<'a, C, A> where C: BorrowMut, A: o /// This may not always be desirable, as you can obtain (newly generated) parts you cannot pass in, /// like statistics that are generated server side. Therefore you should use this method to specify /// the parts you provide in addition to the ones you want in the response. - /// - /// **Settable Parts** - /// - /// * *snippet* - /// * *contentDetails* - /// * *fileDetails* - /// * *liveStreamingDetails* - /// * *localizations* - /// * *player* - /// * *processingDetails* - /// * *recordingDetails* - /// * *statistics* - /// * *status* - /// * *suggestions* - /// * *topicDetails* pub fn part(mut self, new_value: &str) -> VideoUpdateCall<'a, C, A> { self._part = new_value.to_string(); self @@ -12041,32 +11913,6 @@ impl<'a, C, A> VideoUpdateCall<'a, C, A> where C: BorrowMut, A: o /// A builder for the *insert* method supported by a *video* resource. /// It is not used directly, but through a `VideoMethods` instance. /// -/// **Settable Parts** -/// -/// * *snippet* -/// * *contentDetails* -/// * *fileDetails* -/// * *liveStreamingDetails* -/// * *localizations* -/// * *player* -/// * *processingDetails* -/// * *recordingDetails* -/// * *statistics* -/// * *status* -/// * *suggestions* -/// * *topicDetails* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtube.upload* -/// * *https://www.googleapis.com/auth/youtubepartner* -/// -/// The default scope will be `Scope::Full`. -/// /// # Example /// /// Instantiate a resource method builder @@ -12091,28 +11937,16 @@ impl<'a, C, A> VideoUpdateCall<'a, C, A> where C: BorrowMut, A: o /// // 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 = Video::default(); -/// req.status = Default::default(); // is VideoStatus -/// req.topic_details = Default::default(); // is VideoTopicDetails -/// req.suggestions = Default::default(); // is VideoSuggestions -/// req.file_details = Default::default(); // is VideoFileDetails -/// req.player = Default::default(); // is VideoPlayer -/// req.localizations = Default::default(); // is HashMap -/// req.live_streaming_details = Default::default(); // is VideoLiveStreamingDetails -/// req.snippet = Default::default(); // is VideoSnippet -/// req.statistics = Default::default(); // is VideoStatistics -/// req.processing_details = Default::default(); // is VideoProcessingDetails -/// req.content_details = Default::default(); // is VideoContentDetails -/// req.recording_details = Default::default(); // is VideoRecordingDetails /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().insert(req) -/// .stabilize(true) -/// .on_behalf_of_content_owner_channel("vero") -/// .on_behalf_of_content_owner("sadipscing") +/// .stabilize(false) +/// .on_behalf_of_content_owner_channel("invidunt") +/// .on_behalf_of_content_owner("consetetur") /// .notify_subscribers(false) -/// .auto_levels(false) +/// .auto_levels(true) /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -12399,28 +12233,13 @@ impl<'a, C, A> VideoInsertCall<'a, C, A> where C: BorrowMut, A: o /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *snippet* - /// * *contentDetails* - /// * *fileDetails* - /// * *liveStreamingDetails* - /// * *localizations* - /// * *player* - /// * *processingDetails* - /// * *recordingDetails* - /// * *statistics* - /// * *status* - /// * *suggestions* - /// * *topicDetails* pub fn request(mut self, new_value: Video) -> VideoInsertCall<'a, C, A> { self._request = new_value; self } /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. /// - /// The part names that you can include in the parameter value are snippet, contentDetails, fileDetails, liveStreamingDetails, localizations, player, processingDetails, recordingDetails, statistics, status, suggestions, and topicDetails. However, not all of those parts contain properties that can be set when setting or updating a video's metadata. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response. + /// Note that not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response. /// /// Sets the *part* query property to the given value. /// @@ -12429,21 +12248,6 @@ impl<'a, C, A> VideoInsertCall<'a, C, A> where C: BorrowMut, A: o /// This may not always be desirable, as you can obtain (newly generated) parts you cannot pass in, /// like statistics that are generated server side. Therefore you should use this method to specify /// the parts you provide in addition to the ones you want in the response. - /// - /// **Settable Parts** - /// - /// * *snippet* - /// * *contentDetails* - /// * *fileDetails* - /// * *liveStreamingDetails* - /// * *localizations* - /// * *player* - /// * *processingDetails* - /// * *recordingDetails* - /// * *statistics* - /// * *status* - /// * *suggestions* - /// * *topicDetails* pub fn part(mut self, new_value: &str) -> VideoInsertCall<'a, C, A> { self._part = new_value.to_string(); self @@ -12475,7 +12279,7 @@ impl<'a, C, A> VideoInsertCall<'a, C, A> where C: BorrowMut, A: o self._on_behalf_of_content_owner = Some(new_value.to_string()); self } - /// The notifySubscribers parameter indicates whether YouTube should send notification to subscribers about the inserted video. + /// The notifySubscribers parameter indicates whether YouTube should send a notification about the new video to users who subscribe to the video's channel. A parameter value of True indicates that subscribers will be notified of newly uploaded videos. However, a channel owner who is uploading many videos might prefer to set the value to False to avoid sending a notification about each new video to the channel's subscribers. /// /// Sets the *notify subscribers* query property to the given value. pub fn notify_subscribers(mut self, new_value: bool) -> VideoInsertCall<'a, C, A> { @@ -12546,21 +12350,6 @@ impl<'a, C, A> VideoInsertCall<'a, C, A> where C: BorrowMut, A: o /// A builder for the *insert* method supported by a *subscription* resource. /// It is not used directly, but through a `SubscriptionMethods` instance. /// -/// **Settable Parts** -/// -/// * *snippet* -/// * *contentDetails* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtubepartner* -/// -/// The default scope will be `Scope::Full`. -/// /// # Example /// /// Instantiate a resource method builder @@ -12584,8 +12373,6 @@ impl<'a, C, A> VideoInsertCall<'a, C, A> where C: BorrowMut, A: o /// // 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 = Subscription::default(); -/// req.snippet = Default::default(); // is SubscriptionSnippet -/// req.content_details = Default::default(); // is SubscriptionContentDetails /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. @@ -12741,18 +12528,11 @@ impl<'a, C, A> SubscriptionInsertCall<'a, C, A> where C: BorrowMut SubscriptionInsertCall<'a, C, A> { self._request = new_value; self } /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. - /// - /// The part names that you can include in the parameter value are snippet and contentDetails. /// /// Sets the *part* query property to the given value. /// @@ -12761,11 +12541,6 @@ impl<'a, C, A> SubscriptionInsertCall<'a, C, A> where C: BorrowMut SubscriptionInsertCall<'a, C, A> { self._part = new_value.to_string(); self @@ -12827,23 +12602,6 @@ impl<'a, C, A> SubscriptionInsertCall<'a, C, A> where C: BorrowMut SubscriptionInsertCall<'a, C, A> where C: BorrowMut SubscriptionListCall<'a, C, A> where C: BorrowMut, } - /// The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails. + /// The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties. /// @@ -13050,12 +12808,6 @@ impl<'a, C, A> SubscriptionListCall<'a, C, A> where C: BorrowMut, /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* - /// * *contentDetails* pub fn part(mut self, new_value: &str) -> SubscriptionListCall<'a, C, A> { self._part = new_value.to_string(); self @@ -13397,22 +13149,6 @@ impl<'a, C, A> SubscriptionDeleteCall<'a, C, A> where C: BorrowMut SubscriptionDeleteCall<'a, C, A> where C: BorrowMut SearchListCall<'a, C, A> where C: BorrowMut, A: oa } - /// The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet. - /// - /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a search result, the snippet property contains other properties that identify the result's title, description, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. + /// The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. Set the parameter value to snippet. /// /// Sets the *part* query property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* pub fn part(mut self, new_value: &str) -> SearchListCall<'a, C, A> { self._part = new_value.to_string(); self } - /// The videoType parameter lets you restrict a search to a particular type of videos. + /// The videoType parameter lets you restrict a search to a particular type of videos. If you specify a value for this parameter, you must also set the type parameter's value to video. /// /// Sets the *video type* query property to the given value. pub fn video_type(mut self, new_value: &str) -> SearchListCall<'a, C, A> { self._video_type = Some(new_value.to_string()); self } - /// The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com. + /// The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com. If you specify a value for this parameter, you must also set the type parameter's value to video. /// /// Sets the *video syndicated* query property to the given value. pub fn video_syndicated(mut self, new_value: &str) -> SearchListCall<'a, C, A> { self._video_syndicated = Some(new_value.to_string()); self } - /// The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos. + /// The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos. If you specify a value for this parameter, you must also set the type parameter's value to video. /// /// Sets the *video license* query property to the given value. pub fn video_license(mut self, new_value: &str) -> SearchListCall<'a, C, A> { self._video_license = Some(new_value.to_string()); self } - /// The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage. + /// The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage. If you specify a value for this parameter, you must also set the type parameter's value to video. /// /// Sets the *video embeddable* query property to the given value. pub fn video_embeddable(mut self, new_value: &str) -> SearchListCall<'a, C, A> { self._video_embeddable = Some(new_value.to_string()); self } - /// The videoDuration parameter filters video search results based on their duration. + /// The videoDuration parameter filters video search results based on their duration. If you specify a value for this parameter, you must also set the type parameter's value to video. /// /// Sets the *video duration* query property to the given value. pub fn video_duration(mut self, new_value: &str) -> SearchListCall<'a, C, A> { self._video_duration = Some(new_value.to_string()); self } - /// The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos. + /// The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos. If you specify a value for this parameter, you must also set the type parameter's value to video. /// /// Sets the *video dimension* query property to the given value. pub fn video_dimension(mut self, new_value: &str) -> SearchListCall<'a, C, A> { self._video_dimension = Some(new_value.to_string()); self } - /// The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available. + /// The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available. If you specify a value for this parameter, you must also set the type parameter's value to video. /// /// Sets the *video definition* query property to the given value. pub fn video_definition(mut self, new_value: &str) -> SearchListCall<'a, C, A> { self._video_definition = Some(new_value.to_string()); self } - /// The videoCategoryId parameter filters video search results based on their category. + /// The videoCategoryId parameter filters video search results based on their category. If you specify a value for this parameter, you must also set the type parameter's value to video. /// /// Sets the *video category id* query property to the given value. pub fn video_category_id(mut self, new_value: &str) -> SearchListCall<'a, C, A> { self._video_category_id = Some(new_value.to_string()); self } - /// The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions. + /// The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions. If you specify a value for this parameter, you must also set the type parameter's value to video. /// /// Sets the *video caption* query property to the given value. pub fn video_caption(mut self, new_value: &str) -> SearchListCall<'a, C, A> { @@ -13834,6 +13563,8 @@ impl<'a, C, A> SearchListCall<'a, C, A> where C: BorrowMut, A: oa self } /// The q parameter specifies the query term to search for. + /// + /// Your request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either "boating" or "sailing", set the q parameter value to boating|sailing. Similarly, to search for videos matching either "boating" or "sailing" but not "fishing", set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C. /// /// Sets the *q* query property to the given value. pub fn q(mut self, new_value: &str) -> SearchListCall<'a, C, A> { @@ -13884,14 +13615,22 @@ impl<'a, C, A> SearchListCall<'a, C, A> where C: BorrowMut, A: oa self._max_results = Some(new_value); self } - /// The locationRadius, in conjunction with the location parameter, defines a geographic area. If the geographic coordinates associated with a video fall within that area, then the video may be included in search results. This parameter value must be a floating point number followed by a measurement unit. Valid measurement units are m, km, ft, and mi. For example, valid parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not support locationRadius parameter values larger than 1000 kilometers. + /// The locationRadius parameter, in conjunction with the location parameter, defines a circular geographic area. + /// + /// The parameter value must be a floating point number followed by a measurement unit. Valid measurement units are m, km, ft, and mi. For example, valid parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not support locationRadius parameter values larger than 1000 kilometers. + /// + /// Note: See the definition of the location parameter for more information. /// /// Sets the *location radius* query property to the given value. pub fn location_radius(mut self, new_value: &str) -> SearchListCall<'a, C, A> { self._location_radius = Some(new_value.to_string()); self } - /// The location parameter restricts a search to videos that have a geographical location specified in their metadata. The value is a string that specifies geographic latitude/longitude coordinates e.g. (37.42307,-122.08427) + /// The location parameter, in conjunction with the locationRadius parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427). + /// + /// + /// - The location parameter value identifies the point at the center of the area. + /// - The locationRadius parameter specifies the maximum distance that the location associated with a video can be from that point for the video to still be included in the search results.The API returns an error if your request specifies a value for the location parameter but does not also specify a value for the locationRadius parameter. /// /// Sets the *location* query property to the given value. pub fn location(mut self, new_value: &str) -> SearchListCall<'a, C, A> { @@ -13921,7 +13660,7 @@ impl<'a, C, A> SearchListCall<'a, C, A> where C: BorrowMut, A: oa self._for_content_owner = Some(new_value); self } - /// The eventType parameter restricts a search to broadcast events. + /// The eventType parameter restricts a search to broadcast events. If you specify a value for this parameter, you must also set the type parameter's value to video. /// /// Sets the *event type* query property to the given value. pub fn event_type(mut self, new_value: &str) -> SearchListCall<'a, C, A> { @@ -13994,27 +13733,11 @@ impl<'a, C, A> SearchListCall<'a, C, A> where C: BorrowMut, A: oa } -/// Returns a list of supported regions. +/// Returns a list of content regions that the YouTube website supports. /// /// A builder for the *list* method supported by a *i18nRegion* resource. /// It is not used directly, but through a `I18nRegionMethods` instance. /// -/// **Settable Parts** -/// -/// * *id* -/// * *snippet* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtube.readonly* -/// * *https://www.googleapis.com/auth/youtubepartner* -/// -/// The default scope will be `Scope::Readonly`. -/// /// # Example /// /// Instantiate a resource method builder @@ -14037,7 +13760,7 @@ impl<'a, C, A> SearchListCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.i18n_regions().list("part") -/// .hl("clita") +/// .hl("justo") /// .doit(); /// # } /// ``` @@ -14168,17 +13891,12 @@ impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A } - /// The part parameter specifies a comma-separated list of one or more i18nRegion resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet. + /// The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet. /// /// Sets the *part* query property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* pub fn part(mut self, new_value: &str) -> I18nRegionListCall<'a, C, A> { self._part = new_value.to_string(); self @@ -14247,18 +13965,6 @@ impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A /// A builder for the *list* method supported by a *commentThread* resource. /// It is not used directly, but through a `CommentThreadMethods` instance. /// -/// **Settable Parts** -/// -/// * *id* -/// * *snippet* -/// * *replies* -/// -/// # Scopes -/// -/// You will need authorization for the *https://www.googleapis.com/auth/youtube.force-ssl* scope to make a valid call. -/// -/// The default scope will be `Scope::ForceSsl`. -/// /// # Example /// /// Instantiate a resource method builder @@ -14281,15 +13987,16 @@ impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comment_threads().list("part") -/// .video_id("justo") -/// .text_format("est") -/// .search_terms("clita") -/// .page_token("invidunt") -/// .moderation_status("ut") +/// .video_id("clita") +/// .text_format("invidunt") +/// .search_terms("ut") +/// .page_token("dolores") +/// .order("eos") +/// .moderation_status("voluptua.") /// .max_results(82) -/// .id("eos") -/// .channel_id("voluptua.") -/// .all_threads_related_to_channel_id("duo") +/// .id("sed") +/// .channel_id("aliquyam") +/// .all_threads_related_to_channel_id("ea") /// .doit(); /// # } /// ``` @@ -14302,6 +14009,7 @@ pub struct CommentThreadListCall<'a, C, A> _text_format: Option, _search_terms: Option, _page_token: Option, + _order: Option, _moderation_status: Option, _max_results: Option, _id: Option, @@ -14328,7 +14036,7 @@ impl<'a, C, A> CommentThreadListCall<'a, C, A> where C: BorrowMut }; dlg.begin(MethodInfo { id: "youtube.commentThreads.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((13 + self._additional_params.len())); params.push(("part", self._part.to_string())); if let Some(value) = self._video_id { params.push(("videoId", value.to_string())); @@ -14342,6 +14050,9 @@ impl<'a, C, A> CommentThreadListCall<'a, C, A> where C: BorrowMut if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } + if let Some(value) = self._order { + params.push(("order", value.to_string())); + } if let Some(value) = self._moderation_status { params.push(("moderationStatus", value.to_string())); } @@ -14357,7 +14068,7 @@ impl<'a, C, A> CommentThreadListCall<'a, C, A> where C: BorrowMut if let Some(value) = self._all_threads_related_to_channel_id { params.push(("allThreadsRelatedToChannelId", value.to_string())); } - for &field in ["alt", "part", "videoId", "textFormat", "searchTerms", "pageToken", "moderationStatus", "maxResults", "id", "channelId", "allThreadsRelatedToChannelId"].iter() { + for &field in ["alt", "part", "videoId", "textFormat", "searchTerms", "pageToken", "order", "moderationStatus", "maxResults", "id", "channelId", "allThreadsRelatedToChannelId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -14452,23 +14163,17 @@ impl<'a, C, A> CommentThreadListCall<'a, C, A> where C: BorrowMut } - /// The part parameter specifies the commentThread resource parts that the API response will include. Supported values are id, snippet and replies. + /// The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include. /// /// Sets the *part* query property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* - /// * *replies* pub fn part(mut self, new_value: &str) -> CommentThreadListCall<'a, C, A> { self._part = new_value.to_string(); self } - /// The videoId parameter instructs the API to return the comment threads for the video specified by the video id. + /// The videoId parameter instructs the API to return comment threads associated with the specified video ID. /// /// Sets the *video id* query property to the given value. pub fn video_id(mut self, new_value: &str) -> CommentThreadListCall<'a, C, A> { @@ -14482,7 +14187,7 @@ impl<'a, C, A> CommentThreadListCall<'a, C, A> where C: BorrowMut self._text_format = Some(new_value.to_string()); self } - /// The searchTerms parameter instructs the API to limit the returned comments to those which contain the specified search terms. + /// The searchTerms parameter instructs the API to limit the API response to only contain comments that contain the specified search terms. /// /// Note: This parameter is not supported for use in conjunction with the id parameter. /// @@ -14500,6 +14205,15 @@ impl<'a, C, A> CommentThreadListCall<'a, C, A> where C: BorrowMut self._page_token = Some(new_value.to_string()); self } + /// The order parameter specifies the order in which the API response should list comment threads. Valid values are: + /// - time - Comment threads are ordered by time. This is the default behavior. + /// - relevance - Comment threads are ordered by relevance.Note: This parameter is not supported for use in conjunction with the id parameter. + /// + /// Sets the *order* query property to the given value. + pub fn order(mut self, new_value: &str) -> CommentThreadListCall<'a, C, A> { + self._order = Some(new_value.to_string()); + self + } /// Set this parameter to limit the returned comment threads to a particular moderation state. /// /// Note: This parameter is not supported for use in conjunction with the id parameter. @@ -14525,14 +14239,14 @@ impl<'a, C, A> CommentThreadListCall<'a, C, A> where C: BorrowMut self._id = Some(new_value.to_string()); self } - /// The channelId parameter instructs the API to return the comment threads for all the channel comments (not including comments left on videos). + /// The channelId parameter instructs the API to return comment threads containing comments about the specified channel. (The response will not include comments left on videos that the channel uploaded.) /// /// Sets the *channel id* query property to the given value. pub fn channel_id(mut self, new_value: &str) -> CommentThreadListCall<'a, C, A> { self._channel_id = Some(new_value.to_string()); self } - /// The allThreadsRelatedToChannelId parameter instructs the API to return the comment threads of all videos of the channel and the channel comments as well. + /// The allThreadsRelatedToChannelId parameter instructs the API to return all comment threads associated with the specified channel. The response can include comments about the channel or about the channel's videos. /// /// Sets the *all threads related to channel id* query property to the given value. pub fn all_threads_related_to_channel_id(mut self, new_value: &str) -> CommentThreadListCall<'a, C, A> { @@ -14591,23 +14305,11 @@ impl<'a, C, A> CommentThreadListCall<'a, C, A> where C: BorrowMut } -/// Modifies an existing comment. +/// Modifies the top-level comment in a comment thread. /// /// A builder for the *update* method supported by a *commentThread* resource. /// It is not used directly, but through a `CommentThreadMethods` instance. /// -/// **Settable Parts** -/// -/// * *id* -/// * *snippet* -/// * *replies* -/// -/// # Scopes -/// -/// You will need authorization for the *https://www.googleapis.com/auth/youtube.force-ssl* scope to make a valid call. -/// -/// The default scope will be `Scope::ForceSsl`. -/// /// # Example /// /// Instantiate a resource method builder @@ -14631,9 +14333,6 @@ impl<'a, C, A> CommentThreadListCall<'a, C, A> where C: BorrowMut /// // 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 = CommentThread::default(); -/// req.snippet = Default::default(); // is CommentThreadSnippet -/// req.id = Some("sed".to_string()); -/// req.replies = Default::default(); // is CommentThreadReplies /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. @@ -14789,19 +14488,11 @@ impl<'a, C, A> CommentThreadUpdateCall<'a, C, A> where C: BorrowMut CommentThreadUpdateCall<'a, C, A> { self._request = new_value; self } - /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. - /// - /// The part names that you can include in the parameter value are id, snippet and replies. However only snippet contains properties that can be updated. + /// The part parameter specifies a comma-separated list of commentThread resource properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update. /// /// Sets the *part* query property to the given value. /// @@ -14810,12 +14501,6 @@ impl<'a, C, A> CommentThreadUpdateCall<'a, C, A> where C: BorrowMut CommentThreadUpdateCall<'a, C, A> { self._part = new_value.to_string(); self @@ -14872,22 +14557,11 @@ impl<'a, C, A> CommentThreadUpdateCall<'a, C, A> where C: BorrowMut CommentThreadUpdateCall<'a, C, A> where C: BorrowMut CommentThreadInsertCall<'a, C, A> where C: BorrowMut CommentThreadInsertCall<'a, C, A> { self._request = new_value; self } - /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. - /// - /// The part names that you can include in the parameter value are id and snippet. However only snippet contains properties that can be set. + /// The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units. /// /// Sets the *part* query property to the given value. /// @@ -15093,16 +14758,11 @@ impl<'a, C, A> CommentThreadInsertCall<'a, C, A> where C: BorrowMut CommentThreadInsertCall<'a, C, A> { self._part = new_value.to_string(); self } - /// The shareOnGooglePlus determines whether this thread should also be posted on Google+. + /// The shareOnGooglePlus parameter indicates whether the top-level comment and any replies that are made to that comment should also be posted to the author's Google+ profile. /// /// Sets the *share on google plus* query property to the given value. pub fn share_on_google_plus(mut self, new_value: bool) -> CommentThreadInsertCall<'a, C, A> { @@ -15208,14 +14868,14 @@ impl<'a, C, A> CommentThreadInsertCall<'a, C, A> where C: BorrowMut LiveStreamUpdateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.live_streams().delete("id") -/// .on_behalf_of_content_owner_channel("kasd") -/// .on_behalf_of_content_owner("invidunt") +/// .on_behalf_of_content_owner_channel("invidunt") +/// .on_behalf_of_content_owner("rebum.") /// .doit(); /// # } /// ``` @@ -15759,12 +15419,12 @@ impl<'a, C, A> LiveStreamDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.live_streams().list("part") -/// .page_token("Lorem") -/// .on_behalf_of_content_owner_channel("clita") -/// .on_behalf_of_content_owner("invidunt") +/// .page_token("clita") +/// .on_behalf_of_content_owner_channel("invidunt") +/// .on_behalf_of_content_owner("eirmod") /// .mine(false) -/// .max_results(24) -/// .id("consetetur") +/// .max_results(5) +/// .id("et") /// .doit(); /// # } /// ``` @@ -15966,7 +15626,7 @@ impl<'a, C, A> LiveStreamListCall<'a, C, A> where C: BorrowMut, A self._mine = Some(new_value); self } - /// The maxResults parameter specifies the maximum number of items that should be returned in the result set. Acceptable values are 0 to 50, inclusive. The default value is 5. + /// The maxResults parameter specifies the maximum number of items that should be returned in the result set. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> LiveStreamListCall<'a, C, A> { @@ -16079,14 +15739,14 @@ impl<'a, C, A> LiveStreamListCall<'a, C, A> where C: BorrowMut, A /// req.status = Default::default(); // is LiveStreamStatus /// req.snippet = Default::default(); // is LiveStreamSnippet /// req.cdn = Default::default(); // is CdnSettings -/// req.id = Some("et".to_string()); +/// req.id = Some("sed".to_string()); /// /// // 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.live_streams().insert(req) -/// .on_behalf_of_content_owner_channel("sed") -/// .on_behalf_of_content_owner("sit") +/// .on_behalf_of_content_owner_channel("sit") +/// .on_behalf_of_content_owner("takimata") /// .doit(); /// # } /// ``` @@ -16350,24 +16010,11 @@ impl<'a, C, A> LiveStreamInsertCall<'a, C, A> where C: BorrowMut, } -/// Creates a new comment. -/// -/// Note: to create a top level comment it is also necessary to create a comment thread. Both are accomplished through the commentThreads resource. +/// Creates a reply to an existing comment. Note: To create a top-level comment, use the commentThreads.insert method. /// /// A builder for the *insert* method supported by a *comment* resource. /// It is not used directly, but through a `CommentMethods` instance. /// -/// **Settable Parts** -/// -/// * *id* -/// * *snippet* -/// -/// # Scopes -/// -/// You will need authorization for the *https://www.googleapis.com/auth/youtube.force-ssl* scope to make a valid call. -/// -/// The default scope will be `Scope::ForceSsl`. -/// /// # Example /// /// Instantiate a resource method builder @@ -16391,8 +16038,6 @@ impl<'a, C, A> LiveStreamInsertCall<'a, C, A> where C: BorrowMut, /// // 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 = Comment::default(); -/// req.snippet = Default::default(); // is CommentSnippet -/// req.id = Some("takimata".to_string()); /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. @@ -16548,18 +16193,11 @@ impl<'a, C, A> CommentInsertCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* pub fn request(mut self, new_value: Comment) -> CommentInsertCall<'a, C, A> { self._request = new_value; self } - /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. - /// - /// The part names that you can include in the parameter value are id and snippet. However only snippet contains properties that can be set. + /// The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units. /// /// Sets the *part* query property to the given value. /// @@ -16568,11 +16206,6 @@ impl<'a, C, A> CommentInsertCall<'a, C, A> where C: BorrowMut, A: /// This may not always be desirable, as you can obtain (newly generated) parts you cannot pass in, /// like statistics that are generated server side. Therefore you should use this method to specify /// the parts you provide in addition to the ones you want in the response. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* pub fn part(mut self, new_value: &str) -> CommentInsertCall<'a, C, A> { self._part = new_value.to_string(); self @@ -16629,7 +16262,7 @@ impl<'a, C, A> CommentInsertCall<'a, C, A> where C: BorrowMut, A: } -/// Sets the moderation status of one or more comments. +/// Sets the moderation status of one or more comments. The API request must be authorized by the owner of the channel or video associated with the comments. /// /// A builder for the *setModerationStatus* method supported by a *comment* resource. /// It is not used directly, but through a `CommentMethods` instance. @@ -16778,7 +16411,7 @@ impl<'a, C, A> CommentSetModerationStatuCall<'a, C, A> where C: BorrowMut CommentSetModerationStatuCall<'a, C, A> where C: BorrowMut CommentSetModerationStatuCall<'a, C, A> where C: BorrowMut CommentSetModerationStatuCall<'a, C, A> { @@ -17001,7 +16634,7 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: } - /// The id parameter specifies the comment ID for the resource that should be deleted. + /// The id parameter specifies the comment ID for the resource that is being deleted. /// /// Sets the *id* query property to the given value. /// @@ -17068,17 +16701,6 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: /// A builder for the *list* method supported by a *comment* resource. /// It is not used directly, but through a `CommentMethods` instance. /// -/// **Settable Parts** -/// -/// * *id* -/// * *snippet* -/// -/// # Scopes -/// -/// You will need authorization for the *https://www.googleapis.com/auth/youtube.force-ssl* scope to make a valid call. -/// -/// The default scope will be `Scope::ForceSsl`. -/// /// # Example /// /// Instantiate a resource method builder @@ -17252,22 +16874,17 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o } - /// The part parameter specifies the comment resource parts that the API response will include. Supported values are id and snippet. + /// The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include. /// /// Sets the *part* query property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* pub fn part(mut self, new_value: &str) -> CommentListCall<'a, C, A> { self._part = new_value.to_string(); self } - /// Set this parameter's value to html or plainText to instruct the API to return the comments left by users formatted as HTML or as plain text. + /// This parameter indicates whether the API should return comments formatted as HTML or as plain text. /// /// Sets the *text format* query property to the given value. pub fn text_format(mut self, new_value: &str) -> CommentListCall<'a, C, A> { @@ -17276,7 +16893,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o } /// The parentId parameter specifies the ID of the comment for which replies should be retrieved. /// - /// Note: Currently YouTube features only one level of replies (ie replies to top level comments). However replies to replies may be supported in the future. + /// Note: YouTube currently supports replies only for top-level comments. However, replies to replies may be supported in the future. /// /// Sets the *parent id* query property to the given value. pub fn parent_id(mut self, new_value: &str) -> CommentListCall<'a, C, A> { @@ -17301,7 +16918,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o self._max_results = Some(new_value); self } - /// The id parameter specifies a comma-separated list of comment IDs for the resources that should be retrieved. + /// The id parameter specifies a comma-separated list of comment IDs for the resources that are being retrieved. In a comment resource, the id property specifies the comment's ID. /// /// Sets the *id* query property to the given value. pub fn id(mut self, new_value: &str) -> CommentListCall<'a, C, A> { @@ -17360,22 +16977,11 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o } -/// Modifies an existing comment. +/// Modifies a comment. /// /// A builder for the *update* method supported by a *comment* resource. /// It is not used directly, but through a `CommentMethods` instance. /// -/// **Settable Parts** -/// -/// * *id* -/// * *snippet* -/// -/// # Scopes -/// -/// You will need authorization for the *https://www.googleapis.com/auth/youtube.force-ssl* scope to make a valid call. -/// -/// The default scope will be `Scope::ForceSsl`. -/// /// # Example /// /// Instantiate a resource method builder @@ -17399,8 +17005,6 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o /// // 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 = Comment::default(); -/// req.snippet = Default::default(); // is CommentSnippet -/// req.id = Some("ut".to_string()); /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. @@ -17556,18 +17160,11 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* pub fn request(mut self, new_value: Comment) -> CommentUpdateCall<'a, C, A> { self._request = new_value; self } - /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. - /// - /// The part names that you can include in the parameter value are id and snippet. However only snippet contains properties that can be updated. + /// The part parameter identifies the properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update. /// /// Sets the *part* query property to the given value. /// @@ -17576,11 +17173,6 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: /// This may not always be desirable, as you can obtain (newly generated) parts you cannot pass in, /// like statistics that are generated server side. Therefore you should use this method to specify /// the parts you provide in addition to the ones you want in the response. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* pub fn part(mut self, new_value: &str) -> CommentUpdateCall<'a, C, A> { self._part = new_value.to_string(); self @@ -17637,7 +17229,7 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: } -/// Expresses the caller's opinion that a comment is spam. +/// Expresses the caller's opinion that one or more comments should be flagged as spam. /// /// A builder for the *markAsSpam* method supported by a *comment* resource. /// It is not used directly, but through a `CommentMethods` instance. @@ -17779,7 +17371,7 @@ impl<'a, C, A> CommentMarkAsSpamCall<'a, C, A> where C: BorrowMut } - /// The id parameter specifies a comma-separated list of IDs of comments which should get flagged as spam. + /// The id parameter specifies a comma-separated list of IDs of comments that the caller believes should be classified as spam. /// /// Sets the *id* query property to the given value. /// @@ -17841,26 +17433,11 @@ impl<'a, C, A> CommentMarkAsSpamCall<'a, C, A> where C: BorrowMut } -/// Updates a channel's metadata. +/// Updates a channel's metadata. Note that this method currently only supports updates to the channel resource's brandingSettings and invideoPromotion objects and their child properties. /// /// A builder for the *update* method supported by a *channel* resource. /// It is not used directly, but through a `ChannelMethods` instance. /// -/// **Settable Parts** -/// -/// * *id* -/// * *invideoPromotion* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtubepartner* -/// -/// The default scope will be `Scope::Full`. -/// /// # Example /// /// Instantiate a resource method builder @@ -17884,14 +17461,12 @@ impl<'a, C, A> CommentMarkAsSpamCall<'a, C, A> where C: BorrowMut /// // 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 = Channel::default(); -/// req.invideo_promotion = Default::default(); // is InvideoPromotion -/// req.id = Some("sea".to_string()); /// /// // 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.channels().update(req) -/// .on_behalf_of_content_owner("ut") +/// .on_behalf_of_content_owner("dolor") /// .doit(); /// # } /// ``` @@ -18046,20 +17621,15 @@ impl<'a, C, A> ChannelUpdateCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *invideoPromotion* pub fn request(mut self, new_value: Channel) -> ChannelUpdateCall<'a, C, A> { self._request = new_value; self } /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. /// - /// The part names that you can include in the parameter value are id and invideoPromotion. + /// The API currently only allows the parameter value to be set to either brandingSettings or invideoPromotion. (You cannot update both of those parts with a single request.) /// - /// Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. + /// Note that this method overrides the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. /// /// Sets the *part* query property to the given value. /// @@ -18068,11 +17638,6 @@ impl<'a, C, A> ChannelUpdateCall<'a, C, A> where C: BorrowMut, A: /// This may not always be desirable, as you can obtain (newly generated) parts you cannot pass in, /// like statistics that are generated server side. Therefore you should use this method to specify /// the parts you provide in addition to the ones you want in the response. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *invideoPromotion* pub fn part(mut self, new_value: &str) -> ChannelUpdateCall<'a, C, A> { self._part = new_value.to_string(); self @@ -18141,27 +17706,6 @@ impl<'a, C, A> ChannelUpdateCall<'a, C, A> where C: BorrowMut, A: /// A builder for the *list* method supported by a *channel* resource. /// It is not used directly, but through a `ChannelMethods` instance. /// -/// **Settable Parts** -/// -/// * *id* -/// * *snippet* -/// * *contentDetails* -/// * *statistics* -/// * *topicDetails* -/// * *invideoPromotion* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtube.readonly* -/// * *https://www.googleapis.com/auth/youtubepartner* -/// * *https://www.googleapis.com/auth/youtubepartner-channel-audit* -/// -/// The default scope will be `Scope::Readonly`. -/// /// # Example /// /// Instantiate a resource method builder @@ -18184,16 +17728,16 @@ impl<'a, C, A> ChannelUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.channels().list("part") -/// .page_token("sanctus") -/// .on_behalf_of_content_owner("voluptua.") -/// .my_subscribers(false) +/// .page_token("ut") +/// .on_behalf_of_content_owner("eirmod") +/// .my_subscribers(true) /// .mine(true) -/// .max_results(16) +/// .max_results(2) /// .managed_by_me(true) -/// .id("ut") -/// .hl("sed") -/// .for_username("et") -/// .category_id("ipsum") +/// .id("et") +/// .hl("vero") +/// .for_username("ut") +/// .category_id("sed") /// .doit(); /// # } /// ``` @@ -18360,7 +17904,7 @@ impl<'a, C, A> ChannelListCall<'a, C, A> where C: BorrowMut, A: o } - /// The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, statistics, topicDetails, and invideoPromotion. + /// The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include. /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties. /// @@ -18368,15 +17912,6 @@ impl<'a, C, A> ChannelListCall<'a, C, A> where C: BorrowMut, A: o /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* - /// * *contentDetails* - /// * *statistics* - /// * *topicDetails* - /// * *invideoPromotion* pub fn part(mut self, new_value: &str) -> ChannelListCall<'a, C, A> { self._part = new_value.to_string(); self @@ -18388,14 +17923,16 @@ impl<'a, C, A> ChannelListCall<'a, C, A> where C: BorrowMut, A: o self._page_token = Some(new_value.to_string()); self } - /// The onBehalfOfContentOwner parameter indicates that the authenticated user 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 actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner. + /// Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The 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. /// /// Sets the *on behalf of content owner* query property to the given value. pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> ChannelListCall<'a, C, A> { self._on_behalf_of_content_owner = Some(new_value.to_string()); self } - /// Set this parameter's value to true to retrieve a list of channels that subscribed to the authenticated user's channel. + /// Use the subscriptions.list method and its mySubscribers parameter to retrieve a list of subscribers to the authenticated user's channel. /// /// Sets the *my subscribers* query property to the given value. pub fn my_subscribers(mut self, new_value: bool) -> ChannelListCall<'a, C, A> { @@ -18416,6 +17953,8 @@ impl<'a, C, A> ChannelListCall<'a, C, A> where C: BorrowMut, A: o self._max_results = Some(new_value); self } + /// Note: This parameter is intended exclusively for YouTube content partners. + /// /// Set this parameter's value to true to instruct the API to only return channels managed by the content owner that the onBehalfOfContentOwner parameter specifies. The user must be authenticated as a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided. /// /// Sets the *managed by me* query property to the given value. @@ -18545,7 +18084,7 @@ impl<'a, C, A> ChannelListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.video_abuse_report_reasons().list("part") -/// .hl("dolore") +/// .hl("ipsum") /// .doit(); /// # } /// ``` @@ -18755,22 +18294,6 @@ impl<'a, C, A> VideoAbuseReportReasonListCall<'a, C, A> where C: BorrowMut VideoAbuseReportReasonListCall<'a, C, A> where C: BorrowMut PlaylistItemInsertCall<'a, C, A> where C: BorrowMut PlaylistItemInsertCall<'a, C, A> { self._request = new_value; self } /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. - /// - /// The part names that you can include in the parameter value are snippet, contentDetails, and status. /// /// Sets the *part* query property to the given value. /// @@ -18978,12 +18490,6 @@ impl<'a, C, A> PlaylistItemInsertCall<'a, C, A> where C: BorrowMut PlaylistItemInsertCall<'a, C, A> { self._part = new_value.to_string(); self @@ -19258,24 +18764,6 @@ impl<'a, C, A> PlaylistItemDeleteCall<'a, C, A> where C: BorrowMut PlaylistItemDeleteCall<'a, C, A> where C: BorrowMut PlaylistItemListCall<'a, C, A> where C: BorrowMut, } - /// The part parameter specifies a comma-separated list of one or more playlistItem 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. + /// The part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include. /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties. /// @@ -19462,13 +18950,6 @@ impl<'a, C, A> PlaylistItemListCall<'a, C, A> where C: BorrowMut, /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* - /// * *contentDetails* - /// * *status* pub fn part(mut self, new_value: &str) -> PlaylistItemListCall<'a, C, A> { self._part = new_value.to_string(); self @@ -19574,22 +19055,6 @@ impl<'a, C, A> PlaylistItemListCall<'a, C, A> where C: BorrowMut, /// A builder for the *update* method supported by a *playlistItem* resource. /// It is not used directly, but through a `PlaylistItemMethods` instance. /// -/// **Settable Parts** -/// -/// * *snippet* -/// * *contentDetails* -/// * *status* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtubepartner* -/// -/// The default scope will be `Scope::Full`. -/// /// # Example /// /// Instantiate a resource method builder @@ -19613,9 +19078,6 @@ impl<'a, C, A> PlaylistItemListCall<'a, C, A> where C: BorrowMut, /// // 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 = PlaylistItem::default(); -/// req.status = Default::default(); // is PlaylistItemStatus -/// req.snippet = Default::default(); // is PlaylistItemSnippet -/// req.content_details = Default::default(); // is PlaylistItemContentDetails /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. @@ -19771,20 +19233,12 @@ impl<'a, C, A> PlaylistItemUpdateCall<'a, C, A> where C: BorrowMut PlaylistItemUpdateCall<'a, C, A> { self._request = new_value; self } /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. /// - /// The part names that you can include in the parameter value are snippet, contentDetails, and status. - /// /// Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist item can specify a start time and end time, which identify the times portion of the video that should play when users watch the video in the playlist. If your request is updating a playlist item that sets these values, and the request's part parameter value includes the contentDetails part, the playlist item's start and end times will be updated to whatever value the request body specifies. If the request body does not specify values, the existing start and end times will be removed and replaced with the default settings. /// /// Sets the *part* query property to the given value. @@ -19794,12 +19248,6 @@ impl<'a, C, A> PlaylistItemUpdateCall<'a, C, A> where C: BorrowMut PlaylistItemUpdateCall<'a, C, A> { self._part = new_value.to_string(); self @@ -19890,7 +19338,7 @@ impl<'a, C, A> PlaylistItemUpdateCall<'a, C, A> where C: BorrowMut WatermarkSetCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// The channelId parameter specifies a YouTube channel ID for which the watermark is being provided. + /// The channelId parameter specifies the YouTube channel ID for which the watermark is being provided. /// /// Sets the *channel id* query property to the given value. /// @@ -20161,7 +19609,9 @@ impl<'a, C, A> WatermarkSetCall<'a, C, A> where C: BorrowMut, A: self._channel_id = new_value.to_string(); self } - /// The onBehalfOfContentOwner parameter indicates that the authenticated user 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 actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner. + /// Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The 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. /// /// Sets the *on behalf of content owner* query property to the given value. pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> WatermarkSetCall<'a, C, A> { @@ -20220,7 +19670,7 @@ impl<'a, C, A> WatermarkSetCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes a watermark. +/// Deletes a channel's watermark image. /// /// A builder for the *unset* method supported by a *watermark* resource. /// It is not used directly, but through a `WatermarkMethods` instance. @@ -20247,7 +19697,7 @@ impl<'a, C, A> WatermarkSetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.watermarks().unset("channelId") -/// .on_behalf_of_content_owner("elitr") +/// .on_behalf_of_content_owner("labore") /// .doit(); /// # } /// ``` @@ -20367,7 +19817,7 @@ impl<'a, C, A> WatermarkUnsetCall<'a, C, A> where C: BorrowMut, A } - /// The channelId parameter specifies a YouTube channel ID for which the watermark is being unset. + /// The channelId parameter specifies the YouTube channel ID for which the watermark is being unset. /// /// Sets the *channel id* query property to the given value. /// @@ -20377,7 +19827,9 @@ impl<'a, C, A> WatermarkUnsetCall<'a, C, A> where C: BorrowMut, A self._channel_id = new_value.to_string(); self } - /// The onBehalfOfContentOwner parameter indicates that the authenticated user 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 actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner. + /// Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The 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. /// /// Sets the *on behalf of content owner* query property to the given value. pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> WatermarkUnsetCall<'a, C, A> { @@ -20479,11 +19931,11 @@ impl<'a, C, A> WatermarkUnsetCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.live_broadcasts().control("id", "part") -/// .walltime("elitr") -/// .on_behalf_of_content_owner_channel("At") -/// .on_behalf_of_content_owner("sea") -/// .offset_time_ms("consetetur") -/// .display_slate(false) +/// .walltime("consetetur") +/// .on_behalf_of_content_owner_channel("sea") +/// .on_behalf_of_content_owner("elitr") +/// .offset_time_ms("At") +/// .display_slate(true) /// .doit(); /// # } /// ``` @@ -20801,16 +20253,16 @@ impl<'a, C, A> LiveBroadcastControlCall<'a, C, A> where C: BorrowMut LiveBroadcastUpdateCall<'a, C, A> where C: BorrowMut LiveBroadcastInsertCall<'a, C, A> where C: BorrowMut LiveBroadcastListCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.live_broadcasts().delete("id") -/// .on_behalf_of_content_owner_channel("consetetur") -/// .on_behalf_of_content_owner("eirmod") +/// .on_behalf_of_content_owner_channel("Lorem") +/// .on_behalf_of_content_owner("consetetur") /// .doit(); /// # } /// ``` @@ -22000,8 +21452,8 @@ impl<'a, C, A> LiveBroadcastDeleteCall<'a, C, A> where C: BorrowMut LiveBroadcastTransitionCall<'a, C, A> where C: BorrowMut LiveBroadcastTransitionCall<'a, C, A> where C: BorrowMut LiveBroadcastBindCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.captions().delete("id") -/// .on_behalf_of("dolores") -/// .debug_project_id_override("vero") +/// .on_behalf_of_content_owner("clita") +/// .on_behalf_of("eos") +/// .debug_project_id_override("dolores") /// .doit(); /// # } /// ``` @@ -22578,6 +22031,7 @@ pub struct CaptionDeleteCall<'a, C, A> hub: &'a YouTube, _id: String, + _on_behalf_of_content_owner: Option, _on_behalf_of: Option, _debug_project_id_override: Option, _delegate: Option<&'a mut Delegate>, @@ -22601,15 +22055,18 @@ impl<'a, C, A> CaptionDeleteCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "youtube.captions.delete", http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("id", self._id.to_string())); + if let Some(value) = self._on_behalf_of_content_owner { + params.push(("onBehalfOfContentOwner", value.to_string())); + } if let Some(value) = self._on_behalf_of { params.push(("onBehalfOf", value.to_string())); } if let Some(value) = self._debug_project_id_override { params.push(("debugProjectIdOverride", value.to_string())); } - for &field in ["id", "onBehalfOf", "debugProjectIdOverride"].iter() { + for &field in ["id", "onBehalfOfContentOwner", "onBehalfOf", "debugProjectIdOverride"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -22703,6 +22160,15 @@ impl<'a, C, A> CaptionDeleteCall<'a, C, A> where C: BorrowMut, A: self._id = new_value.to_string(); self } + /// Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The 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 actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + /// + /// Sets the *on behalf of content owner* query property to the given value. + pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> CaptionDeleteCall<'a, C, A> { + self._on_behalf_of_content_owner = Some(new_value.to_string()); + self + } /// ID of the Google+ Page for the channel that the request is be on behalf of /// /// Sets the *on behalf of* query property to the given value. @@ -22803,7 +22269,8 @@ impl<'a, C, A> CaptionDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.captions().insert(req) -/// .sync(false) +/// .sync(true) +/// .on_behalf_of_content_owner("consetetur") /// .on_behalf_of("vero") /// .debug_project_id_override("consetetur") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); @@ -22816,6 +22283,7 @@ pub struct CaptionInsertCall<'a, C, A> _request: Caption, _part: String, _sync: Option, + _on_behalf_of_content_owner: Option, _on_behalf_of: Option, _debug_project_id_override: Option, _delegate: Option<&'a mut Delegate>, @@ -22840,7 +22308,7 @@ impl<'a, C, A> CaptionInsertCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "youtube.captions.insert", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); if self._part.len() == 0 { self._part = self._request.to_parts(); } @@ -22848,13 +22316,16 @@ impl<'a, C, A> CaptionInsertCall<'a, C, A> where C: BorrowMut, A: if let Some(value) = self._sync { params.push(("sync", value.to_string())); } + if let Some(value) = self._on_behalf_of_content_owner { + params.push(("onBehalfOfContentOwner", value.to_string())); + } if let Some(value) = self._on_behalf_of { params.push(("onBehalfOf", value.to_string())); } if let Some(value) = self._debug_project_id_override { params.push(("debugProjectIdOverride", value.to_string())); } - for &field in ["alt", "part", "sync", "onBehalfOf", "debugProjectIdOverride"].iter() { + for &field in ["alt", "part", "sync", "onBehalfOfContentOwner", "onBehalfOf", "debugProjectIdOverride"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -23110,6 +22581,15 @@ impl<'a, C, A> CaptionInsertCall<'a, C, A> where C: BorrowMut, A: self._sync = Some(new_value); self } + /// Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The 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 actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + /// + /// Sets the *on behalf of content owner* query property to the given value. + pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> CaptionInsertCall<'a, C, A> { + self._on_behalf_of_content_owner = Some(new_value.to_string()); + self + } /// ID of the Google+ Page for the channel that the request is be on behalf of /// /// Sets the *on behalf of* query property to the given value. @@ -23188,7 +22668,10 @@ impl<'a, C, A> CaptionInsertCall<'a, C, A> where C: BorrowMut, A: /// /// # Scopes /// -/// You will need authorization for the *https://www.googleapis.com/auth/youtube.force-ssl* scope to make a valid call. +/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: +/// +/// * *https://www.googleapis.com/auth/youtube.force-ssl* +/// * *https://www.googleapis.com/auth/youtubepartner* /// /// The default scope will be `Scope::ForceSsl`. /// @@ -23214,9 +22697,10 @@ impl<'a, C, A> CaptionInsertCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.captions().list("part", "videoId") -/// .on_behalf_of("tempor") -/// .id("gubergren") -/// .debug_project_id_override("dolore") +/// .on_behalf_of_content_owner("tempor") +/// .on_behalf_of("gubergren") +/// .id("dolore") +/// .debug_project_id_override("amet.") /// .doit(); /// # } /// ``` @@ -23226,6 +22710,7 @@ pub struct CaptionListCall<'a, C, A> hub: &'a YouTube, _part: String, _video_id: String, + _on_behalf_of_content_owner: Option, _on_behalf_of: Option, _id: Option, _debug_project_id_override: Option, @@ -23250,9 +22735,12 @@ impl<'a, C, A> CaptionListCall<'a, C, A> where C: BorrowMut, A: o }; dlg.begin(MethodInfo { id: "youtube.captions.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); params.push(("part", self._part.to_string())); params.push(("videoId", self._video_id.to_string())); + if let Some(value) = self._on_behalf_of_content_owner { + params.push(("onBehalfOfContentOwner", value.to_string())); + } if let Some(value) = self._on_behalf_of { params.push(("onBehalfOf", value.to_string())); } @@ -23262,7 +22750,7 @@ impl<'a, C, A> CaptionListCall<'a, C, A> where C: BorrowMut, A: o if let Some(value) = self._debug_project_id_override { params.push(("debugProjectIdOverride", value.to_string())); } - for &field in ["alt", "part", "videoId", "onBehalfOf", "id", "debugProjectIdOverride"].iter() { + for &field in ["alt", "part", "videoId", "onBehalfOfContentOwner", "onBehalfOf", "id", "debugProjectIdOverride"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -23382,6 +22870,15 @@ impl<'a, C, A> CaptionListCall<'a, C, A> where C: BorrowMut, A: o self._video_id = new_value.to_string(); self } + /// Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The 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 actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + /// + /// Sets the *on behalf of content owner* query property to the given value. + pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> CaptionListCall<'a, C, A> { + self._on_behalf_of_content_owner = Some(new_value.to_string()); + self + } /// ID of the Google+ Page for the channel that the request is on behalf of. /// /// Sets the *on behalf of* query property to the given value. @@ -23485,10 +22982,11 @@ impl<'a, C, A> CaptionListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.captions().download("id") -/// .tlang("dolore") -/// .tfmt("magna") -/// .on_behalf_of("elitr") -/// .debug_project_id_override("magna") +/// .tlang("magna") +/// .tfmt("elitr") +/// .on_behalf_of_content_owner("magna") +/// .on_behalf_of("ipsum") +/// .debug_project_id_override("invidunt") /// .doit(); /// # } /// ``` @@ -23499,6 +22997,7 @@ pub struct CaptionDownloadCall<'a, C, A> _id: String, _tlang: Option, _tfmt: Option, + _on_behalf_of_content_owner: Option, _on_behalf_of: Option, _debug_project_id_override: Option, _delegate: Option<&'a mut Delegate>, @@ -23522,7 +23021,7 @@ impl<'a, C, A> CaptionDownloadCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "youtube.captions.download", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); params.push(("id", self._id.to_string())); if let Some(value) = self._tlang { params.push(("tlang", value.to_string())); @@ -23530,13 +23029,16 @@ impl<'a, C, A> CaptionDownloadCall<'a, C, A> where C: BorrowMut, if let Some(value) = self._tfmt { params.push(("tfmt", value.to_string())); } + if let Some(value) = self._on_behalf_of_content_owner { + params.push(("onBehalfOfContentOwner", value.to_string())); + } if let Some(value) = self._on_behalf_of { params.push(("onBehalfOf", value.to_string())); } if let Some(value) = self._debug_project_id_override { params.push(("debugProjectIdOverride", value.to_string())); } - for &field in ["id", "tlang", "tfmt", "onBehalfOf", "debugProjectIdOverride"].iter() { + for &field in ["id", "tlang", "tfmt", "onBehalfOfContentOwner", "onBehalfOf", "debugProjectIdOverride"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -23665,6 +23167,15 @@ impl<'a, C, A> CaptionDownloadCall<'a, C, A> where C: BorrowMut, self._tfmt = Some(new_value.to_string()); self } + /// Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The 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 actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + /// + /// Sets the *on behalf of content owner* query property to the given value. + pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> CaptionDownloadCall<'a, C, A> { + self._on_behalf_of_content_owner = Some(new_value.to_string()); + self + } /// ID of the Google+ Page for the channel that the request is be on behalf of /// /// Sets the *on behalf of* query property to the given value. @@ -23766,8 +23277,9 @@ impl<'a, C, A> CaptionDownloadCall<'a, C, A> where C: BorrowMut, /// // Values shown here are possibly random and not representative ! /// let result = hub.captions().update(req) /// .sync(true) -/// .on_behalf_of("invidunt") -/// .debug_project_id_override("accusam") +/// .on_behalf_of_content_owner("labore") +/// .on_behalf_of("diam") +/// .debug_project_id_override("nonumy") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -23778,6 +23290,7 @@ pub struct CaptionUpdateCall<'a, C, A> _request: Caption, _part: String, _sync: Option, + _on_behalf_of_content_owner: Option, _on_behalf_of: Option, _debug_project_id_override: Option, _delegate: Option<&'a mut Delegate>, @@ -23802,7 +23315,7 @@ impl<'a, C, A> CaptionUpdateCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "youtube.captions.update", http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); if self._part.len() == 0 { self._part = self._request.to_parts(); } @@ -23810,13 +23323,16 @@ impl<'a, C, A> CaptionUpdateCall<'a, C, A> where C: BorrowMut, A: if let Some(value) = self._sync { params.push(("sync", value.to_string())); } + if let Some(value) = self._on_behalf_of_content_owner { + params.push(("onBehalfOfContentOwner", value.to_string())); + } if let Some(value) = self._on_behalf_of { params.push(("onBehalfOf", value.to_string())); } if let Some(value) = self._debug_project_id_override { params.push(("debugProjectIdOverride", value.to_string())); } - for &field in ["alt", "part", "sync", "onBehalfOf", "debugProjectIdOverride"].iter() { + for &field in ["alt", "part", "sync", "onBehalfOfContentOwner", "onBehalfOf", "debugProjectIdOverride"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -24072,6 +23588,15 @@ impl<'a, C, A> CaptionUpdateCall<'a, C, A> where C: BorrowMut, A: self._sync = Some(new_value); self } + /// Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The 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 actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + /// + /// Sets the *on behalf of content owner* query property to the given value. + pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> CaptionUpdateCall<'a, C, A> { + self._on_behalf_of_content_owner = Some(new_value.to_string()); + self + } /// ID of the Google+ Page for the channel that the request is be on behalf of /// /// Sets the *on behalf of* query property to the given value. @@ -24143,22 +23668,6 @@ impl<'a, C, A> CaptionUpdateCall<'a, C, A> where C: BorrowMut, A: /// A builder for the *list* method supported by a *videoCategory* resource. /// It is not used directly, but through a `VideoCategoryMethods` instance. /// -/// **Settable Parts** -/// -/// * *id* -/// * *snippet* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtube.readonly* -/// * *https://www.googleapis.com/auth/youtubepartner* -/// -/// The default scope will be `Scope::Readonly`. -/// /// # Example /// /// Instantiate a resource method builder @@ -24182,8 +23691,8 @@ impl<'a, C, A> CaptionUpdateCall<'a, C, A> where C: BorrowMut, A: /// // Values shown here are possibly random and not representative ! /// let result = hub.video_categories().list("part") /// .region_code("diam") -/// .id("nonumy") -/// .hl("sed") +/// .id("magna") +/// .hl("dolor") /// .doit(); /// # } /// ``` @@ -24322,17 +23831,12 @@ impl<'a, C, A> VideoCategoryListCall<'a, C, A> where C: BorrowMut } - /// The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet. + /// The part parameter specifies the videoCategory resource properties that the API response will include. Set the parameter value to snippet. /// /// Sets the *part* query property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* pub fn part(mut self, new_value: &str) -> VideoCategoryListCall<'a, C, A> { self._part = new_value.to_string(); self @@ -24415,22 +23919,6 @@ impl<'a, C, A> VideoCategoryListCall<'a, C, A> where C: BorrowMut /// A builder for the *list* method supported by a *activity* resource. /// It is not used directly, but through a `ActivityMethods` instance. /// -/// **Settable Parts** -/// -/// * *id* -/// * *snippet* -/// * *contentDetails* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// * *https://www.googleapis.com/auth/youtube.readonly* -/// -/// The default scope will be `Scope::Readonly`. -/// /// # Example /// /// Instantiate a resource method builder @@ -24453,14 +23941,14 @@ impl<'a, C, A> VideoCategoryListCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.activities().list("part") -/// .region_code("magna") -/// .published_before("dolor") -/// .published_after("Lorem") -/// .page_token("dolor") -/// .mine(true) -/// .max_results(10) +/// .region_code("dolor") +/// .published_before("vero") +/// .published_after("nonumy") +/// .page_token("takimata") +/// .mine(false) +/// .max_results(5) /// .home(true) -/// .channel_id("dolores") +/// .channel_id("amet.") /// .doit(); /// # } /// ``` @@ -24619,20 +24107,14 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: } - /// The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails. + /// The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. /// - /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. + /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. /// /// Sets the *part* query property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* - /// * *contentDetails* pub fn part(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { self._part = new_value.to_string(); self @@ -24752,20 +24234,6 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: /// A builder for the *insert* method supported by a *activity* resource. /// It is not used directly, but through a `ActivityMethods` instance. /// -/// **Settable Parts** -/// -/// * *snippet* -/// * *contentDetails* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// -/// The default scope will be `Scope::Full`. -/// /// # Example /// /// Instantiate a resource method builder @@ -24789,8 +24257,6 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: /// // 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 = Activity::default(); -/// req.snippet = Default::default(); // is ActivitySnippet -/// req.content_details = Default::default(); // is ActivityContentDetails /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. @@ -24946,18 +24412,11 @@ impl<'a, C, A> ActivityInsertCall<'a, C, A> where C: BorrowMut, A /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *snippet* - /// * *contentDetails* pub fn request(mut self, new_value: Activity) -> ActivityInsertCall<'a, C, A> { self._request = new_value; self } /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. - /// - /// The part names that you can include in the parameter value are snippet and contentDetails. /// /// Sets the *part* query property to the given value. /// @@ -24966,11 +24425,6 @@ impl<'a, C, A> ActivityInsertCall<'a, C, A> where C: BorrowMut, A /// This may not always be desirable, as you can obtain (newly generated) parts you cannot pass in, /// like statistics that are generated server side. Therefore you should use this method to specify /// the parts you provide in addition to the ones you want in the response. - /// - /// **Settable Parts** - /// - /// * *snippet* - /// * *contentDetails* pub fn part(mut self, new_value: &str) -> ActivityInsertCall<'a, C, A> { self._part = new_value.to_string(); self diff --git a/gen/youtubeanalytics1-cli/Cargo.toml b/gen/youtubeanalytics1-cli/Cargo.toml index 79f04c3718..ca0660e4ca 100644 --- a/gen/youtubeanalytics1-cli/Cargo.toml +++ b/gen/youtubeanalytics1-cli/Cargo.toml @@ -17,8 +17,8 @@ keywords = ["youtubeAnalytics", "google", "cli"] name = "youtubeanalytics1" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" strsim = "*" diff --git a/gen/youtubeanalytics1-cli/src/main.rs b/gen/youtubeanalytics1-cli/src/main.rs index 7ba50f7011..1392cb7f59 100644 --- a/gen/youtubeanalytics1-cli/src/main.rs +++ b/gen/youtubeanalytics1-cli/src/main.rs @@ -89,6 +89,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -140,6 +141,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -281,6 +283,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -336,6 +339,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -478,6 +482,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -539,6 +544,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -633,6 +639,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -703,6 +710,7 @@ impl<'n, 'a> Engine<'n, 'a> { 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(()) } } @@ -818,7 +826,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() @@ -831,7 +839,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() diff --git a/gen/youtubeanalytics1/Cargo.toml b/gen/youtubeanalytics1/Cargo.toml index e804033904..986bbed67a 100644 --- a/gen/youtubeanalytics1/Cargo.toml +++ b/gen/youtubeanalytics1/Cargo.toml @@ -16,8 +16,8 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.5.2" -mime = "0.0.11" +hyper = ">= 0.6.0" +mime = "0.0.12" serde = ">= 0.4.1" yup-oauth2 = "*" url = "*" diff --git a/gen/youtubeanalytics1/src/cmn.rs b/gen/youtubeanalytics1/src/cmn.rs index 6294f5a77b..defecc802c 100644 --- a/gen/youtubeanalytics1/src/cmn.rs +++ b/gen/youtubeanalytics1/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) } }